commit
6fcc7494f3
|
@ -35,12 +35,14 @@ export default function ChatPage(props: any) {
|
|||
const { id } = useParams();
|
||||
const context = useAppContext();
|
||||
|
||||
let firstLoad = true;
|
||||
useEffect(() => {
|
||||
if (props.share || !context.currentChat.chatLoadedAt) {
|
||||
return;
|
||||
}
|
||||
|
||||
const shouldScroll = (Date.now() - context.currentChat.chatLoadedAt) > 5000;
|
||||
const shouldScroll = (Date.now() - context.currentChat.chatLoadedAt) > 5000 || firstLoad;
|
||||
firstLoad = false;
|
||||
|
||||
if (!shouldScroll) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue