Skip to content

Commit 0449b42

Browse files
committed
Fix bug that blocked new service worker installation
Previous service workers have been running fine, but new service workers weren't able to install due to this issue, blocking offline usage for new users.
1 parent c9cda18 commit 0449b42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/server-api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export const announceServerReady = () => serverReady.resolve();
3636
export const waitUntilServerReady = () => serverReady.promise;
3737

3838
const apiClient: Promise<GraphQLApiClient | RestApiClient> = authTokenPromise.then(async (authToken) => {
39-
await waitUntilServerReady();
39+
// Delay checking, just to avoid spamming requests that we know won't work. Doesn't work
40+
// in the SW, which doesn't get a server-ready ping, and is delayed quite a while anyway.
41+
if (!RUNNING_IN_WORKER) await waitUntilServerReady();
4042

4143
const restClient = new RestApiClient(authToken);
4244
const graphQLClient = new GraphQLApiClient(authToken);

0 commit comments

Comments
 (0)