Fix share button: ES module namespace was not extensible

window.AtShare was assigned the module namespace object from
import('./share'), which is frozen. share.init.ts then threw
'Cannot add property refresh, object is not extensible', aborting the
click handler so the share button did nothing on every page.

- runtime.ts: spread the namespace into a plain object
- share.init.ts: expose the updater as window.AtShareRefresh
- home.init.ts / stop.init.ts: call AtShareRefresh
- remove the temporary probe marker from StopView

Verified: /?s=at_main_terminal, /stops/:code?q=, /routes/:id, /check/:id
all produce short links and restore state on load (TH and EN).
This commit is contained in:
Bkk1234 committed 2026-10-23 23:26:18 +07:00
1 parent 2fa73f43d9
commit 66d7e235c3
6 files changed
+8 -7

No files matched your search

+1 -1
View File
@@ -442,7 +442,7 @@ function nm(o: any, base: string): string {
function refreshShareLink() {
var S = (window as any).AtShare;
if (S && S.refresh) S.refresh();
if (typeof (window as any).AtShareRefresh === 'function') (window as any).AtShareRefresh();
}
initHomeSelectors();