Skip to content

Commit

Permalink
Merge pull request #8463 from wireapp/fix/WPB-14927_context-menu
Browse files Browse the repository at this point in the history
fix: contentMenu issues with inputs [WPB-14927]
  • Loading branch information
aweiss-dev authored Jan 15, 2025
2 parents 15c94ce + 32e94c7 commit 8a90e80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion electron/src/window/WindowUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ export const openExternal = async (url: string, httpsOnly: boolean = false): Pro
}
};

const isBrowserWindow = (baseWindow: unknown): baseWindow is BrowserWindow => {
return baseWindow instanceof Object && 'webContents' in baseWindow;
};

export const sendToWebContents = (baseWindow: BaseWindow | undefined, channel: string, ...args: any[]) => {
if (baseWindow instanceof BrowserWindow) {
if (isBrowserWindow(baseWindow)) {
try {
baseWindow.webContents.send(channel, ...args);
} catch (error) {
Expand Down

0 comments on commit 8a90e80

Please sign in to comment.