[MM-51961] Migrate calls widget to singleton (#2667)

* Migrate callsWidgetWindow to singleton

* REVERT ME: removed references to ServerManager
This commit is contained in:
Devin Binnie
2023-04-12 07:50:34 -04:00
committed by GitHub
parent 741087cb55
commit 661099dd28
8 changed files with 1249 additions and 1372 deletions

View File

@@ -25,6 +25,7 @@ jest.mock('electron', () => ({
jest.mock('main/contextMenu', () => jest.fn());
jest.mock('../allowProtocolDialog', () => ({}));
jest.mock('main/windows/callsWidgetWindow', () => ({}));
jest.mock('main/views/viewManager', () => ({
getViewByWebContentsId: jest.fn(),
getViewByURL: jest.fn(),

View File

@@ -10,7 +10,8 @@ import urlUtils from 'common/utils/url';
import {flushCookiesStore} from 'main/app/utils';
import ContextMenu from 'main/contextMenu';
import WindowManager from '../windows/windowManager';
import CallsWidgetWindow from 'main/windows/callsWidgetWindow';
import WindowManager from 'main/windows/windowManager';
import {protocols} from '../../../electron-builder.json';
@@ -84,7 +85,7 @@ export class WebContentsEventManager {
return;
}
const callID = WindowManager.callsWidgetWindow?.getCallID();
const callID = CallsWidgetWindow.callID;
if (serverURL && callID && urlUtils.isCallsPopOutURL(serverURL, parsedURL, callID)) {
return;
}