Skip to content

Commit e2a9d1f

Browse files
committed
fixup! ✈️(frontend) allow editing when offline
1 parent 1f2879b commit e2a9d1f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/frontend/apps/impress/src/features/service-worker/service-worker.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,20 @@ registerRoute(
235235
}),
236236
);
237237

238+
/**
239+
* External urls post cache strategy
240+
* It is interesting to intercept the request
241+
* to have a fine grain control about if the user is
242+
* online or offline
243+
*/
244+
registerRoute(
245+
({ url }) => !url.href.includes(self.location.origin) && !isApiUrl(url.href),
246+
new NetworkOnly({
247+
plugins: [new OfflinePlugin()],
248+
}),
249+
'POST',
250+
);
251+
238252
/**
239253
* Cache all other files
240254
*/

0 commit comments

Comments
 (0)