cheogram-www
created pr with
cheogram-www/tauri-alpha.1
commented
Changes are available at https://tangled.org/mrry.band/cheogram-www on branch tauri-alpha.
added cheogram-www/tauri-alpha.2
1: 45e8ad7 = 1: 45e8ad7 Refactor service worker access
2: fab4022 ! 2: ce66e8f Move notifications code to one file
-: ------- > 3: 10e3574 Refactor notification code
3: d127ee0 ! 4: ba0891f npm run tauri init
4: 9e006bd = 5: 5b3abf9 Request microphone and camera usage on mac
5: 03d4934 = 6: 994a2e9 Tauri file system media store
6: b96216a = 7: 320fa8f Don't register or use serviceworker in tauri
7: faace0a = 8: e76db17 Open links in browser
8: 9c07308 ! 9: 761dd22 Tauri notifications
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-www:tauri-alpha | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-www:tauri-alpha [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-www:tauri-alphaadd comment to patch request:
ssh pr.pico.sh comment cheogram-www:tauri-alpha "lgtm!"
Patchset
cheogram-www/tauri-alpha.2
Refactor service worker access
Eric Roberts
Move notifications code to one file
2026-10-29T14:50:23ZEric Roberts
Refactor notification code
2026-11-04T14:34:43ZEric Roberts
npm run tauri init
2026-11-04T16:17:25ZEric Roberts
Request microphone and camera usage on mac
2026-10-16T14:01:30ZEric Roberts
Tauri file system media store
2026-10-20T19:29:32ZEric Roberts
→ Don't register or use serviceworker in tauri
2026-10-16T18:10:16ZEric Roberts
Open links in browser
2026-10-19T18:23:24ZEric Roberts
Tauri notifications
2026-10-20T18:39:35ZEric Roberts
2026-10-19T19:40:11Z
Don't register or use serviceworker in tauri
Eric Roberts
2026-10-19T18:23:24ZWe can't register service workers in tauri because of the tauri:// protocol that gets used (service workers need https://). We also can't rely on checking for the service worker because webview will return a truthy object, but awaiting ready will hang forever. Most places we were checking for a service worker we were awaiting ready, so I made a little helper to cleanup that code, and neither serviceWorker or readyServiceWorker will return if we are running in Tauri.
Semantic diff summary
0 added,
2 modified,
0 signature changed,
0 removed
across 2 analyzed files
+1
-1
src/App.tsx
#
| ... | ... | @@ -183,7 +183,7 @@ const AppInner = () => { | |
| 183 | 183 | }; | |
| 184 | 184 | serviceWorker.addEventListener("message", handler); | |
| 185 | 185 | ||
| 186 | - | return () => serviceWorker.removeEventListener("message", handler); | |
| 186 | + | return () => serviceWorker?.removeEventListener("message", handler); | |
| 187 | 187 | }, [accounts, onNotificationClick, onNotificationClose]); | |
| 188 | 188 | ||
| 189 | 189 | return ( |
+2
-1
src/util.ts
#
| ... | ... | @@ -1,9 +1,10 @@ | |
| 1 | 1 | import * as borogove from "borogove"; | |
| 2 | + | import { isTauri } from "@tauri-apps/api/core"; | |
| 2 | 3 | import Delta from "quill-delta"; | |
| 3 | 4 | import { href as rhref } from "react-router"; | |
| 4 | 5 | import { useRef, useCallback, useEffect, useSyncExternalStore } from "react"; | |
| 5 | 6 | ||
| 6 | - | export const serviceWorker = navigator.serviceWorker; | |
| 7 | + | export const serviceWorker = isTauri() ? undefined : navigator.serviceWorker; | |
| 7 | 8 | export const readyServiceWorker = serviceWorker?.ready ?? Promise.resolve(null); | |
| 8 | 9 | ||
| 9 | 10 | export const ios = navigator.userAgent.match(/(iPad|iPhone|iPod)/g); |