Skip to content

Commit 9a4e4e2

Browse files
committed
update
1 parent b4e71da commit 9a4e4e2

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

apps/bplan-client/src/ReloadPrompt.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {useRegisterSW} from 'virtual:pwa-register/solid'
2-
import {createSignal, JSX, Show} from 'solid-js'
1+
import {JSX, Show} from 'solid-js'
32
import {preventGlobalTouchAttrs} from 'src/components/real-button/use-global-touch'
3+
import {useRegisterSW} from 'virtual:pwa-register/solid'
44

55
export interface ReloadPromptProps extends JSX.HTMLAttributes<HTMLDivElement> {
66
//
@@ -49,7 +49,11 @@ export const ReloadPrompt = (props: ReloadPromptProps) => {
4949
>
5050
Reload
5151
</button>
52-
<button class="b-0 cusor-pointer rd-1 px-2 py-1" onClick={handleClose}>
52+
<button
53+
class="b-0 cusor-pointer rd-1 px-2 py-1"
54+
onClick={handleClose}
55+
onTouchEnd={handleClose}
56+
>
5357
Skip
5458
</button>
5559
</div>

apps/bplan-client/vite.config.mts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import {fileURLToPath, URL} from 'node:url'
44
import unoCss from 'unocss/vite'
55

66
export default defineConfig({
7+
server: {
8+
prerender: {
9+
routes: ['/'],
10+
},
11+
},
712
vite: {
813
build: {
914
minify: false,
@@ -26,6 +31,10 @@ export default defineConfig({
2631
handler: 'NetworkFirst',
2732
options: {
2833
cacheName: 'html-cache',
34+
networkTimeoutSeconds: 3,
35+
precacheFallback: {
36+
fallbackURL: '/index.html',
37+
},
2938
},
3039
urlPattern: ({request}) => request.destination === 'document',
3140
},
@@ -41,6 +50,9 @@ export default defineConfig({
4150
handler: 'CacheFirst',
4251
options: {
4352
cacheName: 'image-cache',
53+
expiration: {
54+
maxAgeSeconds: 2_592_000,
55+
},
4456
},
4557
urlPattern: ({request}) => ['image'].includes(request.destination),
4658
},

0 commit comments

Comments
 (0)