[MM-55152] Add new Desktop API endpoints, improve preload script, some clean-up (#2900)

* Add constants for app info, add to API

* Migrate history button

* Converted calls API over to context bridge, removed some unnecessary logging

* Convert to TS, add types for web app to consume

* Fix tests, prune

* Fix lint

* More changes to support the legacy API

* Force legacy code off, add support for unreads/mentions/expired through the API

* Fix issues with cross-tab login, removed need for log in/log out signalling

* Fixed test, typos

* Change package name for types

* Add some other stuff to the types

* PR feedback

* More feedback

* Use npm package

* Change types and API to provide off listeners

* Version number

* Lock

* Fix typo

* Add sessionID for calls
This commit is contained in:
Devin Binnie
2023-12-13 09:39:46 -05:00
committed by GitHub
parent 675ec6d661
commit 0cab09b7f5
41 changed files with 1071 additions and 1040 deletions

View File

@@ -4,7 +4,6 @@
import {app, IpcMainEvent, IpcMainInvokeEvent, Menu} from 'electron';
import {UniqueServer} from 'types/config';
import {MentionData} from 'types/notification';
import ServerViewState from 'app/serverViewState';
@@ -92,7 +91,7 @@ export function handleWelcomeScreenModal() {
const html = getLocalURLString('welcomeScreen.html');
const preload = getLocalPreload('desktopAPI.js');
const preload = getLocalPreload('internalAPI.js');
const mainWindow = MainWindow.get();
if (!mainWindow) {
@@ -114,9 +113,9 @@ export function handleWelcomeScreenModal() {
}
}
export function handleMentionNotification(event: IpcMainEvent, title: string, body: string, channel: {id: string}, teamId: string, url: string, silent: boolean, data: MentionData) {
log.debug('handleMentionNotification', {title, body, channel, teamId, url, silent, data});
NotificationManager.displayMention(title, body, channel, teamId, url, silent, event.sender, data);
export function handleMentionNotification(event: IpcMainEvent, title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) {
log.debug('handleMentionNotification', {title, body, channelId, teamId, url, silent, soundName});
NotificationManager.displayMention(title, body, channelId, teamId, url, silent, event.sender, soundName);
}
export function handleOpenAppMenu() {