cheogram-www

created pr with cheogram-www/tauri-alpha.1 on 2026-10-29T17:17:18Z · by 3c31bc8c
commented on 2026-10-29T17:17:19Z · by 3c31bc8c
Changes are available at https://tangled.org/mrry.band/cheogram-www on branch tauri-alpha.
added cheogram-www/tauri-alpha.2 on 2026-11-04T17:46:08Z · by 3c31bc8c
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 -3
checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-www:tauri-alpha [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-www:tauri-alpha
add comment to patch request:
ssh pr.pico.sh comment cheogram-www:tauri-alpha "lgtm!"

Patchset cheogram-www/tauri-alpha.1 on 2026-10-29T17:17:18Z · commit b96216a

Don't register or use serviceworker in tauri
Eric Roberts 2026-10-19T18:23:24Z
We 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 #
......@@ -178,7 +178,7 @@ const AppInner = () => {
178178 };
179179 serviceWorker.addEventListener("message", handler);
180180
181- return () => serviceWorker.removeEventListener("message", handler);
181+ return () => serviceWorker?.removeEventListener("message", handler);
182182 }, [accounts, navigate]);
183183
184184 return (
+2 -1 src/util.ts #
......@@ -1,9 +1,10 @@
11 import * as borogove from "borogove";
2+import { isTauri } from "@tauri-apps/api/core";
23 import Delta from "quill-delta";
34 import { href as rhref } from "react-router";
45 import { useRef, useCallback, useEffect, useSyncExternalStore } from "react";
56
6-export const serviceWorker = navigator.serviceWorker;
7+export const serviceWorker = isTauri() ? undefined : navigator.serviceWorker;
78 export const readyServiceWorker = serviceWorker?.ready ?? Promise.resolve(null);
89
910 export const ios = navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
Back to top