feat: re-send unreads on login

This commit is contained in:
KernelDeimos
2024-06-15 14:58:32 -04:00
committed by Eric Dubé
parent a1e6887bf9
commit 02fc4d86b7
3 changed files with 61 additions and 0 deletions

View File

@@ -117,6 +117,19 @@ async function UIDesktop(options){
});
});
window.__already_got_unreads = false;
window.socket.on('notif.unreads', ({ unreads }) => {
if ( window.__already_got_unreads ) return;
window.__already_got_unreads = true;
for ( const notif_info of unreads ) {
const notification = notif_info.notification;
UINotification({
content: notification.summary
});
}
});
window.socket.on('app.opened', async (app) => {
// don't update if this is the original client that initiated the action
if(app.original_client_socket_id === window.socket.id)