[MM-51514] Allow Calls widget to open user settings (#3109)
* Allow Calls widget to open user settings * Bump api-types version * Bump
This commit is contained in:
parent
314f7ab96f
commit
e2cc1cee4b
|
@ -76,6 +76,9 @@ export type DesktopAPI = {
|
|||
openStopRecordingModal: (channelID: string) => void;
|
||||
onOpenStopRecordingModal: (listener: (channelID: string) => void) => () => void;
|
||||
|
||||
openCallsUserSettings: () => void;
|
||||
onOpenCallsUserSettings: (listener: () => void) => () => void;
|
||||
|
||||
// Utility
|
||||
unregister: (channel: string) => void;
|
||||
}
|
||||
|
|
2
api-types/lib/index.d.ts
vendored
2
api-types/lib/index.d.ts
vendored
|
@ -63,5 +63,7 @@ export type DesktopAPI = {
|
|||
onOpenThreadForCalls: (listener: (threadID: string) => void) => () => void;
|
||||
openStopRecordingModal: (channelID: string) => void;
|
||||
onOpenStopRecordingModal: (listener: (channelID: string) => void) => () => void;
|
||||
openCallsUserSettings: () => void;
|
||||
onOpenCallsUserSettings: (listener: () => void) => () => void;
|
||||
unregister: (channel: string) => void;
|
||||
};
|
||||
|
|
4
api-types/package-lock.json
generated
4
api-types/package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@mattermost/desktop-api",
|
||||
"version": "5.9.0-1",
|
||||
"version": "5.10.0-1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@mattermost/desktop-api",
|
||||
"version": "5.9.0-1",
|
||||
"version": "5.10.0-1",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"typescript": "^4.3.0 || ^5.0.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mattermost/desktop-api",
|
||||
"version": "5.9.0-1",
|
||||
"version": "5.10.0-1",
|
||||
"description": "Shared types for the Desktop App API provided to the Web App",
|
||||
"keywords": [
|
||||
"mattermost"
|
||||
|
|
|
@ -134,6 +134,7 @@ export const CALLS_ERROR = 'calls-error';
|
|||
export const CALLS_JOIN_REQUEST = 'calls-join-request';
|
||||
export const CALLS_WIDGET_OPEN_THREAD = 'calls-widget-open-thread';
|
||||
export const CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL = 'calls-widget-open-stop-recording-modal';
|
||||
export const CALLS_WIDGET_OPEN_USER_SETTINGS = 'calls-widget-open-user-settings';
|
||||
|
||||
export const REQUEST_CLEAR_DOWNLOADS_DROPDOWN = 'request-clear-downloads-dropdown';
|
||||
export const CLOSE_DOWNLOADS_DROPDOWN = 'close-downloads-dropdown';
|
||||
|
|
|
@ -38,6 +38,7 @@ import {
|
|||
CALLS_POPOUT_FOCUS,
|
||||
CALLS_WIDGET_OPEN_THREAD,
|
||||
CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL,
|
||||
CALLS_WIDGET_OPEN_USER_SETTINGS,
|
||||
GET_DESKTOP_SOURCES,
|
||||
UNREADS_AND_MENTIONS,
|
||||
LEGACY_OFF,
|
||||
|
@ -117,6 +118,9 @@ const desktopAPI: DesktopAPI = {
|
|||
openStopRecordingModal: (channelID) => ipcRenderer.send(CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL, channelID),
|
||||
onOpenStopRecordingModal: (listener) => createListener(CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL, listener),
|
||||
|
||||
openCallsUserSettings: () => ipcRenderer.send(CALLS_WIDGET_OPEN_USER_SETTINGS),
|
||||
onOpenCallsUserSettings: (listener) => createListener(CALLS_WIDGET_OPEN_USER_SETTINGS, listener),
|
||||
|
||||
// Utility
|
||||
unregister: (channel) => ipcRenderer.removeAllListeners(channel),
|
||||
};
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
CALLS_WIDGET_SHARE_SCREEN,
|
||||
CALLS_WIDGET_OPEN_THREAD,
|
||||
CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL,
|
||||
CALLS_WIDGET_OPEN_USER_SETTINGS,
|
||||
DESKTOP_SOURCES_MODAL_REQUEST,
|
||||
GET_DESKTOP_SOURCES,
|
||||
UPDATE_SHORTCUT_MENU,
|
||||
|
@ -77,6 +78,7 @@ export class CallsWidgetWindow {
|
|||
ipcMain.on(CALLS_JOIN_REQUEST, this.forwardToMainApp(CALLS_JOIN_REQUEST));
|
||||
ipcMain.on(CALLS_WIDGET_OPEN_THREAD, this.handleCallsOpenThread);
|
||||
ipcMain.on(CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL, this.handleCallsOpenStopRecordingModal);
|
||||
ipcMain.on(CALLS_WIDGET_OPEN_USER_SETTINGS, this.forwardToMainApp(CALLS_WIDGET_OPEN_USER_SETTINGS));
|
||||
|
||||
// deprecated in favour of CALLS_LINK_CLICK
|
||||
ipcMain.on(CALLS_WIDGET_CHANNEL_LINK_CLICK, this.handleCallsWidgetChannelLinkClick);
|
||||
|
|
|
@ -24,4 +24,5 @@ export interface ExternalAPI {
|
|||
createListener(event: 'desktop-sources-modal-request', listener: () => void): () => void;
|
||||
createListener(event: 'calls-widget-open-thread', listener: (threadID: string) => void): () => void;
|
||||
createListener(event: 'calls-widget-open-stop-recording-modal', listener: (channelID: string) => void): () => void;
|
||||
createListener(event: 'calls-widget-open-user-settings', listener: () => void): () => void;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue