mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-4103 Presence status removal on sign out (#1771)
* SDA-4103 Presence status removal on sign out * UT fix
This commit is contained in:
committed by
GitHub
parent
f857998c04
commit
d26e8b4f01
@@ -297,6 +297,7 @@ ipcMain.on(
|
||||
const mainWindow = windowHandler.getMainWindow();
|
||||
if (mainWebContents) {
|
||||
const items = presenceStatus.createThumbarButtons();
|
||||
presenceStatus.updateSystemTrayPresence();
|
||||
mainWindow?.setThumbarButtons(items);
|
||||
logger.info('main-api-handler: Add actions preview menu');
|
||||
}
|
||||
@@ -322,12 +323,12 @@ ipcMain.on(
|
||||
* This gets called from mana, when user logs out
|
||||
*/
|
||||
case apiCmds.closeAllWrapperWindows:
|
||||
windowHandler.closeAllWindows();
|
||||
const main = windowHandler.getMainWindow();
|
||||
terminateC9Shell();
|
||||
|
||||
main?.setThumbarButtons([]);
|
||||
presenceStatus.updateSignedOutContextMenu();
|
||||
windowHandler.closeAllWindows();
|
||||
presenceStatus.onSignOut();
|
||||
break;
|
||||
case apiCmds.setZoomLevel:
|
||||
if (typeof arg.zoomLevel === 'number') {
|
||||
|
||||
@@ -213,7 +213,19 @@ class PresenceStatus {
|
||||
tray?.setContextMenu(contextMenu);
|
||||
};
|
||||
|
||||
public updateSignedOutContextMenu = () => {
|
||||
public onSignOut = () => {
|
||||
const offlinePresence: IPresenceStatus = {
|
||||
statusCategory: EPresenceStatusCategory.OFFLINE,
|
||||
statusGroup: EPresenceStatusGroup.HIDE_PRESENCE,
|
||||
timestamp: Date.now(),
|
||||
};
|
||||
presenceStatusStore.setNotificationCount(0);
|
||||
presenceStatusStore.setPresence(offlinePresence);
|
||||
showBadgeCount(0);
|
||||
const backgroundImage = presenceStatusStore.generateImagePath(
|
||||
offlinePresence.statusGroup,
|
||||
'tray',
|
||||
);
|
||||
const tray = presenceStatusStore.getCurrentTray();
|
||||
const contextDefault = Menu.buildFromTemplate([
|
||||
{
|
||||
@@ -221,8 +233,8 @@ class PresenceStatus {
|
||||
click: () => app.quit(),
|
||||
},
|
||||
]);
|
||||
|
||||
tray?.setContextMenu(contextDefault);
|
||||
tray?.setImage(backgroundImage);
|
||||
};
|
||||
|
||||
private handlePresenceChange = (
|
||||
|
||||
Reference in New Issue
Block a user