[MM-52879] Fixed calls popout URL checking (#2725)
This commit is contained in:
@@ -78,7 +78,7 @@ export class WebContentsEventManager {
|
||||
}
|
||||
|
||||
if (CallsWidgetWindow.isCallsWidget(webContentsId)) {
|
||||
return CallsWidgetWindow.getURL();
|
||||
return CallsWidgetWindow.getViewURL();
|
||||
}
|
||||
|
||||
return ViewManager.getViewByWebContentsId(webContentsId)?.view.server.url;
|
||||
|
@@ -438,15 +438,16 @@ describe('main/windows/callsWidgetWindow', () => {
|
||||
expect(callsWidgetWindow.popOut).not.toBeDefined();
|
||||
});
|
||||
|
||||
it('getURL', () => {
|
||||
it('getViewURL', () => {
|
||||
const callsWidgetWindow = new CallsWidgetWindow();
|
||||
callsWidgetWindow.win = {
|
||||
webContents: {
|
||||
getURL: () => 'http://localhost:8065/',
|
||||
callsWidgetWindow.mainView = {
|
||||
view: {
|
||||
server: {
|
||||
url: new URL('http://localhost:8065/'),
|
||||
},
|
||||
},
|
||||
};
|
||||
urlUtils.parseURL.mockImplementation((url) => new URL(url));
|
||||
expect(callsWidgetWindow.getURL().toString()).toBe('http://localhost:8065/');
|
||||
expect(callsWidgetWindow.getViewURL().toString()).toBe('http://localhost:8065/');
|
||||
});
|
||||
|
||||
describe('isAllowedEvent', () => {
|
||||
|
@@ -94,8 +94,8 @@ export class CallsWidgetWindow {
|
||||
* Helper functions
|
||||
*/
|
||||
|
||||
getURL = () => {
|
||||
return this.win && parseURL(this.win?.webContents.getURL());
|
||||
getViewURL = () => {
|
||||
return this.mainView?.view.server.url;
|
||||
}
|
||||
|
||||
isCallsWidget = (webContentsId: number) => {
|
||||
|
@@ -7,8 +7,6 @@ import {SHOW_SETTINGS_WINDOW} from 'common/communication';
|
||||
import Config from 'common/config';
|
||||
import {Logger} from 'common/log';
|
||||
|
||||
import ViewManager from 'main/views/viewManager';
|
||||
|
||||
import ContextMenu from '../contextMenu';
|
||||
import {getLocalPreload, getLocalURLString} from '../utils';
|
||||
|
||||
|
Reference in New Issue
Block a user