Use synchronous IPC for passing config
This commit is contained in:
parent
3e586be46a
commit
bd41d7b216
6 changed files with 87 additions and 97 deletions
|
@ -1,12 +1,10 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { RendererConfigType } from '../types/RendererConfig';
|
||||
import { strictAssert } from '../util/assert';
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
const params = new URLSearchParams(document.location.search);
|
||||
const configParam = params.get('config');
|
||||
strictAssert(typeof configParam === 'string', 'config is not a string');
|
||||
const config: RendererConfigType = JSON.parse(configParam);
|
||||
import type { RendererConfigType } from '../types/RendererConfig';
|
||||
|
||||
const config: RendererConfigType = ipcRenderer.sendSync('get-config');
|
||||
|
||||
export { config };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue