diff --git a/server/src/shared/bundle.ts b/server/src/shared/bundle.ts index cb6bd7c..0b9c3d9 100644 --- a/server/src/shared/bundle.ts +++ b/server/src/shared/bundle.ts @@ -229,10 +229,11 @@ export async function generateBundle( // Dashboard entities are surfaced to the kiosk as `web` cells // pointing at /dash/ — kiosk WebKit handles them // identically to user-supplied web cells. - contentType = ent.type === "dashboard" ? "web" : ent.type; + contentType = (ent.type === "dashboard" || ent.type === "ablesign") ? "web" : ent.type; cameraId = ent.type === "camera" ? ent.camera_id : null; webUrl = ent.type === "web" ? ent.web_url : + ent.type === "ablesign" ? ent.web_url : ent.type === "dashboard" && ent.dashboard_id ? `/dash/${ent.dashboard_id}` : null; htmlContent = ent.type === "html" ? ent.html_content : null; diff --git a/server/src/shared/db/repository.ts b/server/src/shared/db/repository.ts index 97436b9..8f377c7 100644 --- a/server/src/shared/db/repository.ts +++ b/server/src/shared/db/repository.ts @@ -254,8 +254,14 @@ export class Repository { // =========================================================================== async getSetupState(): Promise { - const r = await this._get("SELECT * FROM setup_state WHERE id = 1"); - if (!r) throw new Error("setup_state row missing"); + let r = await this._get("SELECT * FROM setup_state WHERE id = 1"); + if (!r) { + await this._run( + "INSERT INTO setup_state (id, is_complete, extras) VALUES (1, false, '{}') ON CONFLICT (id) DO NOTHING", + ); + r = await this._get("SELECT * FROM setup_state WHERE id = 1"); + if (!r) throw new Error("setup_state row could not be created"); + } return rowToSetupState(r as Record); }