File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @ducanh2912/next-pwa " : patch
3+ ---
4+
5+ fix(cofen): fixed type errors
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Workbox } from "workbox-window";
22
33import type { MessageType } from "./sw-entry-worker.js" ;
44
5- declare const __PWA_START_URL__ : URL | RequestInfo ;
5+ declare const __PWA_START_URL__ : string | undefined ;
66declare const __PWA_SW__ : string ;
77declare const __PWA_ENABLE_REGISTER__ : boolean ;
88declare const __PWA_CACHE_ON_FRONT_END_NAV__ : boolean ;
3939 const cacheOnFrontEndNav = async (
4040 originalUrl ?: string | URL | null | undefined
4141 ) => {
42- if ( ! window . navigator . onLine ) {
42+ if ( ! window . navigator . onLine || ! originalUrl ) {
4343 return ;
4444 }
4545
46- const url = originalUrl
47- ? originalUrl instanceof URL
46+ const url =
47+ originalUrl instanceof URL
4848 ? originalUrl . toString ( )
4949 : typeof originalUrl === "string"
5050 ? originalUrl
51- : undefined
52- : undefined ;
51+ : undefined ;
5352
5453 if ( typeof url !== "string" ) return ;
5554
56- const isStartUrl =
57- ! ! __PWA_START_URL__ && originalUrl === __PWA_START_URL__ ;
55+ const isStartUrl = ! ! __PWA_START_URL__ && url === __PWA_START_URL__ ;
5856
5957 if ( isStartUrl ) {
6058 if ( ! swEntryWorker ) {
You can’t perform that action at this time.
0 commit comments