Files
mattermost-mobile/app/actions/websocket/integrations.ts
Elias Nahum 6eadc527bb Gekidou Android share extension (#6803)
* Refactor app database queries to not require the app database as argument

* Android Share Extension and fix notifications prompt

* feedback review
2022-11-30 23:18:56 +02:00

23 lines
712 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import IntegrationsManager from '@managers/integrations_manager';
import {getActiveServerUrl} from '@queries/app/servers';
export async function handleOpenDialogEvent(serverUrl: string, msg: WebSocketMessage) {
const data: string = msg.data?.dialog;
if (!data) {
return;
}
try {
const dialog: InteractiveDialogConfig = JSON.parse(data);
const currentServer = await getActiveServerUrl();
if (currentServer === serverUrl) {
IntegrationsManager.getManager(serverUrl).setDialog(dialog);
}
} catch {
// Do nothing
}
}