From 66d7e235c3f51d9d663d1b91b2d2f12a6ad02e8f Mon Sep 17 00:00:00 2001 From: Bkk1234 Date: Fri, 23 Oct 2026 23:26:18 +0700 Subject: [PATCH] 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). --- frontend/src/components/views/StopView.tsx | 1 - frontend/src/lib/runtime.ts | 3 ++- frontend/src/lib/ui/home.init.ts | 2 +- frontend/src/lib/ui/share.init.ts | 5 +++-- frontend/src/lib/ui/stop.init.ts | 2 +- frontend/tsconfig.tsbuildinfo | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/views/StopView.tsx b/frontend/src/components/views/StopView.tsx index 6e4966e..8b5dd27 100644 --- a/frontend/src/components/views/StopView.tsx +++ b/frontend/src/components/views/StopView.tsx @@ -47,7 +47,6 @@ export default function StopView() {
-
{/* ปุ่มแชร์หน้านี้ — จำตัวกรองสายรถที่เลือกอยู่ลงลิงก์ */}