[MM-55153] Consolidate Desktop App API, use new contextBridge endpoints when available (#25438)

* Create Desktop API module, migrate message passing code

* Changes to use new API

* Use Desktop API to notify when mentions/unreads/expired changes

* Expose Desktop App module to plugins

* Fix lint

* PR feedback

* Fixed an issue where I forgot to check if the method exists first

* Slight API changes

* Fix package

* Convert all to class, add comments, small reworks for PR feedback
Этот коммит содержится в:
Devin Binnie
2023-12-04 14:09:46 -05:00
коммит произвёл GitHub
родитель 8bf9e4c481
Коммит d62122b884
16 изменённых файлов: 401 добавлений и 179 удалений

Просмотреть файл

@@ -19,6 +19,7 @@ import Avatar from 'components/widgets/users/avatar';
import {getHistory} from 'utils/browser_history';
import {ModalIdentifiers} from 'utils/constants';
import DesktopApp from 'utils/desktop_api';
import messageHtmlToComponent from 'utils/message_html_to_component';
import * as NotificationSounds from 'utils/notification_sounds';
import {formatText} from 'utils/text_formatting';
@@ -103,3 +104,6 @@ window.ProductApi = {
getRhsSelectedPostId: getSelectedPostId,
getIsRhsOpen,
};
// Desktop App module containing the app info and a series of helpers to work with legacy code
window.DesktopApp = DesktopApp;