Skip to content

Commit 55c259b

Browse files
committed
[frontend] skipWaiting in service worker
1 parent 5e57819 commit 55c259b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

frontend/public/sw.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ async function handleRequest(event) {
1212
return fetch(event.request);
1313
}
1414

15+
self.addEventListener("install", () => {
16+
self.skipWaiting();
17+
});
18+
1519
self.addEventListener("fetch", (event) => {
1620
event.respondWith(handleRequest(event));
1721
});

frontend/src/Browser.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ export type GlobalHistoryEntry = {
5353
export class Browser extends StatefulClass {
5454
built: boolean = false;
5555

56-
tabs: Tab[] = [];
56+
tabs: Tab[];
5757
activetab: Tab;
5858

59-
globalhistory: HistoryState[] = [];
59+
globalhistory: HistoryState[];
6060

6161
unfocusframes: boolean = false;
6262

6363
constructor() {
6464
super(createState(Object.create(Browser.prototype)));
65+
this.tabs = [];
66+
this.globalhistory = [];
6567

6668
setInterval(saveBrowserState, 1000);
6769
}

0 commit comments

Comments
 (0)