[MM-42086] Upgrade to Electron v17 (#2013)

* [MM-42086] Upgrade to Electron v17

* Added viewName

* merge'd

* Update package-lock

* Try it again
This commit is contained in:
Devin Binnie
2022-03-14 10:09:36 -04:00
committed by GitHub
parent 90202f1fbe
commit 14197d1707
12 changed files with 524 additions and 523 deletions

View File

@@ -27,6 +27,8 @@ import {
APP_LOGGED_OUT,
GET_VIEW_NAME,
GET_VIEW_WEBCONTENTS_ID,
DISPATCH_GET_DESKTOP_SOURCES,
DESKTOP_SOURCES_RESULT,
} from 'common/communication';
const UNREAD_COUNT_INTERVAL = 1000;
@@ -149,6 +151,10 @@ window.addEventListener('message', ({origin, data = {}} = {}) => {
ipcRenderer.send(BROWSER_HISTORY_BUTTON, viewName);
break;
}
case 'get-desktop-sources': {
ipcRenderer.send(DISPATCH_GET_DESKTOP_SOURCES, viewName, message);
break;
}
}
});
@@ -274,17 +280,14 @@ window.addEventListener('storage', (e) => {
}
});
contextBridge.exposeInMainWorld('desktopCapturer', {
getSources: async (options) => {
const sources = await desktopCapturer.getSources(options);
return sources.map((source) => {
return {
id: source.id,
name: source.name,
thumbnailURL: source.thumbnail.toDataURL(),
};
});
},
ipcRenderer.on(DESKTOP_SOURCES_RESULT, (event, sources) => {
window.postMessage(
{
type: 'desktop-sources-result',
message: sources,
},
window.location.origin,
);
});
/* eslint-enable no-magic-numbers */