Subscribe to native theme changes

This commit is contained in:
Fedor Indutny 2021-06-30 10:07:42 -07:00 committed by GitHub
parent bb457dd086
commit 795fb9ee0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -2284,6 +2284,10 @@ export async function startApp(): Promise<void> {
}
}
window.subscribeToSystemThemeChange(() => {
onChangeTheme();
});
const FIVE_MINUTES = 5 * 60 * 1000;
// Note: once this function returns, there still might be messages being processed on

2
ts/window.d.ts vendored
View File

@ -166,6 +166,8 @@ declare global {
WhatIsThis: WhatIsThis;
subscribeToSystemThemeChange: (fn: () => void) => void;
registerScreenShareControllerRenderer: (
f: (
component: typeof CallingScreenSharingController,