Use SignalContext instead of SignalWindow

This commit is contained in:
Josh Perez 2021-10-07 19:28:47 -04:00 committed by GitHub
parent a70a8a88d6
commit 75dab30367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 180 additions and 231 deletions

View file

@ -24,7 +24,7 @@ type SystemThemeType = 'dark' | 'light';
export type SystemThemeHolder = { systemTheme: SystemThemeType };
type NativeThemeType = {
export type NativeThemeType = {
getSystemTheme: () => SystemThemeType;
subscribe: (fn: Callback) => void;
update: () => SystemThemeType;

View file

@ -1,28 +0,0 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { Bytes } from './Bytes';
import { Crypto } from './Crypto';
import { Timers } from './Timers';
import {
createNativeThemeListener,
MinimalIPC,
} from './createNativeThemeListener';
export class Context {
public readonly bytes = new Bytes();
public readonly crypto = new Crypto();
public readonly timers = new Timers();
public readonly nativeThemeListener;
constructor(private readonly ipc: MinimalIPC) {
this.nativeThemeListener = createNativeThemeListener(ipc, window);
}
setIsCallActive(isCallActive: boolean): void {
this.ipc.send('set-is-call-active', isCallActive);
}
}