fix plugins array serialization
Summary: new electron deprecated non-clonable serialization over ipc https://www.electronjs.org/docs/breaking-changes#behavior-changed-sending-non-js-objects-over-ipc-now-throws-an-exception Reviewed By: m1sk Differential Revision: D22455119 fbshipit-source-id: 075cc63e740d9f7986fc5a5ab7af605f8fc60bc8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
73906322ee
commit
1c7113418d
@@ -23,12 +23,20 @@ ipcRenderer.on('parent-window-id', (event, message) => {
|
|||||||
flipperState.mainWindowId = message;
|
flipperState.mainWindowId = message;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function cleanUpGWTArray(arr) {
|
||||||
|
const res = [];
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
res.push(arr[i]);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
function initClient(plugins, appName) {
|
function initClient(plugins, appName) {
|
||||||
if (flipperState.isClientInit) {
|
if (flipperState.isClientInit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plugins) {
|
if (plugins) {
|
||||||
flipperState.plugins = plugins;
|
flipperState.plugins = cleanUpGWTArray(plugins);
|
||||||
}
|
}
|
||||||
if (appName) {
|
if (appName) {
|
||||||
flipperState.appName = appName;
|
flipperState.appName = appName;
|
||||||
|
|||||||
Reference in New Issue
Block a user