mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
more timeout mess aroundary
This commit is contained in:
1 parent
9cccf91a84
commit
8191a9431c
5 files changed
+28
-23
No files matched your search
@@ -27,11 +27,24 @@ export const MessageModal = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!activeMessageGroup?.groupId) return;
|
||||
|
||||
const timeout = window.setTimeout(() => {
|
||||
setMimimumLoadPassed(true);
|
||||
}, MINIMUM_LOAD_TIME);
|
||||
return () => window.clearTimeout(timeout);
|
||||
});
|
||||
|
||||
const interval = window.setInterval(() => {
|
||||
if (!activeMessageGroup) return;
|
||||
Nui.send("phone:fetchMessages", {
|
||||
groupId: activeMessageGroup.groupId,
|
||||
});
|
||||
}, MESSAGES_REFRESH_RATE);
|
||||
|
||||
return () => {
|
||||
window.clearInterval(interval);
|
||||
window.clearTimeout(timeout);
|
||||
};
|
||||
}, [activeMessageGroup?.groupId]);
|
||||
|
||||
useEffect(() => {
|
||||
// when we get a new message group we should scroll to the
|
||||
@@ -44,14 +57,6 @@ export const MessageModal = () => {
|
||||
}
|
||||
}, [minimumLoadPassed, messages?.length]);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = window.setInterval(() => {
|
||||
if (!activeMessageGroup) return;
|
||||
Nui.send("phone:fetchMessages", { groupId: activeMessageGroup.groupId });
|
||||
}, MESSAGES_REFRESH_RATE);
|
||||
return () => window.clearInterval(interval);
|
||||
});
|
||||
|
||||
// we add a minimum (but short) load time here so that
|
||||
// there isn't a quick flash of loading and immediately
|
||||
// another flash to the tweets screen.
|
||||
|
||||
Reference in new issue
Block a user