MM-52857 - Expose webapp and desktop notifications to plugins (#23779)

* prevent media keys from controlling calls ring sounds

* stop ring on pause

* expose notifyMe as sendDesktopNotificationToMe

* Revert "stop ring on pause"

This reverts commit 83d62ad02d.

* Revert "prevent media keys from controlling calls ring sounds"

This reverts commit 6d4ff63936.

* move into WebappUtils

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Christopher Poile
2023-06-23 14:29:59 -04:00
committed by GitHub
parent cad2df1259
commit 4e64590564
2 changed files with 3 additions and 1 deletions

View File

@@ -210,7 +210,7 @@ export function sendDesktopNotification(post, msgProps) {
};
}
const notifyMe = (title, body, channel, teamId, silent, soundName, url) => (dispatch) => {
export const notifyMe = (title, body, channel, teamId, silent, soundName, url) => (dispatch) => {
// handle notifications in desktop app
if (isDesktopApp()) {
const msg = {

View File

@@ -2,6 +2,7 @@
// See LICENSE.txt for license information.
import {closeRightHandSide, selectPostById} from 'actions/views/rhs';
import {notifyMe} from 'actions/notification_actions';
import {getSelectedPostId, getIsRhsOpen} from 'selectors/rhs';
import BotTag from 'components/widgets/tag/bot_tag';
@@ -50,6 +51,7 @@ window.useNotifyAdmin = useNotifyAdmin;
window.WebappUtils = {
modals: {openModal, ModalIdentifiers},
notificationSounds: {ring: NotificationSounds.ring, stopRing: NotificationSounds.stopRing},
sendDesktopNotificationToMe: notifyMe,
};
Object.defineProperty(window.WebappUtils, 'browserHistory', {
get: () => getHistory(),