Skip to content

Commit 7561690

Browse files
committed
API.client locks up unpredictably
1 parent aaada06 commit 7561690

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/background/sw/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {CONNECTED, createPortProxy, initRemotePort} from '@/js/port';
66
import * as prefs from '@/js/prefs';
77
import {ownRoot, workerPath} from '@/js/urls';
88
import {setSystemDark} from '../color-scheme';
9-
import {bgInit} from '../common';
9+
import {bgBusy} from '../common';
1010
import {cloudDrive} from '../db-to-cloud-broker';
1111
import setClientData from '../set-client-data';
1212
import offscreen, {getOffscreenClient, getWindowClients} from './offscreen';
@@ -70,9 +70,8 @@ prefs.subscribe('styleViaXhr', (key, val) => {
7070
}
7171
}, true);
7272

73-
bgInit.push(
74-
API.client.isDark().then(setSystemDark),
75-
);
73+
// not using bgPreInit because we can't reliably exclude the onfetch client
74+
bgBusy.then(() => API.client.isDark().then(setSystemDark));
7675

7776
/**
7877
* This ensures that SW starts even before our page makes a clientData request inside.

0 commit comments

Comments
 (0)