Notifications: Put actions inside onclick handler

This commit is contained in:
Scott Nonnenberg 2023-08-01 13:33:04 -07:00 committed by GitHub
parent 269cd9b51d
commit ae0aef52dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,30 +199,33 @@ class NotificationService extends EventEmitter {
tag: messageId, tag: messageId,
}); });
// Note: this maps to the xmlTemplate() function in app/WindowsNotifications.ts notification.onclick = () => {
if ( // Note: this maps to the xmlTemplate() function in app/WindowsNotifications.ts
type === NotificationType.Message || if (
type === NotificationType.Reaction type === NotificationType.Message ||
) { type === NotificationType.Reaction
window.IPC.showWindow(); ) {
window.Events.showConversationViaNotification({ window.IPC.showWindow();
conversationId, window.Events.showConversationViaNotification({
messageId, conversationId,
storyId, messageId,
}); storyId,
} else if (type === NotificationType.IncomingGroupCall) { });
window.IPC.showWindow(); } else if (type === NotificationType.IncomingGroupCall) {
window.reduxActions?.calling?.startCallingLobby({ window.IPC.showWindow();
conversationId, window.reduxActions?.calling?.startCallingLobby({
isVideoCall: true, conversationId,
}); isVideoCall: true,
} else if (type === NotificationType.IsPresenting) { });
window.reduxActions?.calling?.setPresenting(); } else if (type === NotificationType.IsPresenting) {
} else if (type === NotificationType.IncomingCall) { window.reduxActions?.calling?.setPresenting();
window.IPC.showWindow(); } else if (type === NotificationType.IncomingCall) {
} else { window.IPC.showWindow();
throw missingCaseError(type); } else {
} throw missingCaseError(type);
}
};
this.lastNotification = notification; this.lastNotification = notification;
} }