Add backgrounded stream+messages title notifier. Closes #2208

This commit is contained in:
Gabe Kangas
2022-10-18 19:21:03 -07:00
parent bace51d27a
commit 37cdbb8dbd
3 changed files with 84 additions and 2 deletions

View File

@@ -329,6 +329,8 @@ export const ClientConfigStore: FC = () => {
}
};
const handleChatNotification = () => {};
// Read the config and status on initial load from a JSON string that lives
// in window. This is placed there server-side and allows for fast initial
// load times because we don't have to wait for the API calls to complete.
@@ -339,7 +341,7 @@ export const ClientConfigStore: FC = () => {
setClientConfig(config);
}
} catch (e) {
// console.error('Error parsing config hydration', e);
console.error('Error parsing config hydration', e);
}
try {
@@ -348,7 +350,7 @@ export const ClientConfigStore: FC = () => {
setServerStatus(status);
}
} catch (e) {
// console.error('error parsing status hydration', e);
console.error('error parsing status hydration', e);
}
}, []);
@@ -364,6 +366,11 @@ export const ClientConfigStore: FC = () => {
}
}, [hasLoadedConfig, accessToken]);
// Notify about chat activity when backgrounded.
useEffect(() => {
handleChatNotification();
}, [chatMessages]);
useEffect(() => {
updateClientConfig();
handleUserRegistration();