From d122bddae2d6ea94706296b4da47657e665db8b6 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 14 Feb 2021 19:16:40 +0100 Subject: [PATCH] web: update flow diagram on ak-refresh --- web/src/pages/flows/FlowDiagram.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/pages/flows/FlowDiagram.ts b/web/src/pages/flows/FlowDiagram.ts index d31f60cc1..a1118aa21 100644 --- a/web/src/pages/flows/FlowDiagram.ts +++ b/web/src/pages/flows/FlowDiagram.ts @@ -11,8 +11,11 @@ export const FILL_LIGHT_MODE = "#f0f0f0"; @customElement("ak-flow-diagram") export class FlowDiagram extends LitElement { + _flowSlug?: string; + @property() set flowSlug(value: string) { + this._flowSlug = value; Flow.diagram(value).then((data) => { this.diagram = FlowChart.parse(data.diagram); }); @@ -33,6 +36,10 @@ export class FlowDiagram extends LitElement { constructor() { super(); + this.addEventListener("ak-refresh", () => { + if (!this._flowSlug) return + this.flowSlug = this._flowSlug; + }); window.matchMedia("(prefers-color-scheme: light)").addEventListener("change", (ev) => { if (ev.matches) { this.fontColour = FONT_COLOUR_LIGHT_MODE;