No flickering for sync topic
This commit is contained in:
parent
eecd689ad5
commit
1771cb3fdb
4 changed files with 28 additions and 42 deletions
|
@ -71,25 +71,11 @@ const Layout = () => {
|
|||
|| (config.base_url === s.baseUrl && params.topic === s.topic)
|
||||
});
|
||||
|
||||
useConnectionListeners(subscriptions, users);
|
||||
useConnectionListeners(account, subscriptions, users);
|
||||
useAccountListener(setAccount)
|
||||
useBackgroundProcesses();
|
||||
useEffect(() => updateTitle(newNotificationsCount), [newNotificationsCount]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!account || !account.sync_topic) {
|
||||
return;
|
||||
}
|
||||
(async () => {
|
||||
const subscription = await subscriptionManager.add(config.base_url, account.sync_topic);
|
||||
if (!subscription.hidden) {
|
||||
await subscriptionManager.update(subscription.id, {
|
||||
internal: true
|
||||
});
|
||||
}
|
||||
})();
|
||||
}, [account]);
|
||||
|
||||
return (
|
||||
<Box sx={{display: 'flex'}}>
|
||||
<ActionBar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue