Get native theme through IPC not remote
This commit is contained in:
parent
d2cc8e5aa9
commit
71572db7a9
16 changed files with 227 additions and 60 deletions
|
@ -20,7 +20,7 @@ const storageMap = new Map();
|
|||
|
||||
// To replicate logic we have on the client side
|
||||
global.window = {
|
||||
SignalContext: new SignalContext(),
|
||||
SignalContext: undefined,
|
||||
log: {
|
||||
info: (...args) => console.log(...args),
|
||||
warn: (...args) => console.warn(...args),
|
||||
|
@ -38,6 +38,21 @@ global.window = {
|
|||
isValidGuid,
|
||||
};
|
||||
|
||||
const fakeIPC = {
|
||||
sendSync(channel) {
|
||||
// See `ts/context/NativeThemeListener.ts`
|
||||
if (channel === 'native-theme:init') {
|
||||
return { shouldUseDarkColors: true };
|
||||
}
|
||||
|
||||
throw new Error(`Unsupported sendSync channel: ${channel}`);
|
||||
},
|
||||
|
||||
on() {},
|
||||
};
|
||||
|
||||
global.window.SignalContext = new SignalContext(fakeIPC);
|
||||
|
||||
// For ducks/network.getEmptyState()
|
||||
global.navigator = {};
|
||||
global.WebSocket = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue