From 669c79f0b7145c51050f6242f9b1e051563a3c18 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sun, 25 Feb 2024 08:01:33 +0100 Subject: [PATCH] More reliable refresh that possible can handle app downtime --- src/back/routes/dashboard.sreact.tsx | 31 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/back/routes/dashboard.sreact.tsx b/src/back/routes/dashboard.sreact.tsx index 3f09cf8..76e8096 100644 --- a/src/back/routes/dashboard.sreact.tsx +++ b/src/back/routes/dashboard.sreact.tsx @@ -40,7 +40,11 @@ export default new (class DashboardPage extends StatefulPage "" }); + if (ctx.headers["just-data"]) { + return content; + } else { + return html(ctx, "Dashboard", content, { navbar: () => "" }); + } } render(ctx: BaseContext, state: State, inputs: Record) { @@ -75,13 +79,24 @@ export default new (class DashboardPage extends StatefulPage - { - /* HTML */ `` - } + {ctx.headers["just-data"] + ? "" + : /* HTML */ ``} ); }