From 89225c94bd755bdbf8fc5279f6bf81b13b846d8a Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Thu, 27 Aug 2026 07:22:53 +0000 Subject: [PATCH] Preserve Beat Prompt state on reload --- js/h3_beat_prompt/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/h3_beat_prompt/index.js b/js/h3_beat_prompt/index.js index 2493b7e..e955d00 100644 --- a/js/h3_beat_prompt/index.js +++ b/js/h3_beat_prompt/index.js @@ -205,9 +205,9 @@ function normalizeState(value) { function readState(node) { return normalizeState( - node._dh3bpState + node.properties?.[STATE_PROPERTY] || findWidget(node, HIDDEN_INPUT_NAME)?.value - || node.properties?.[STATE_PROPERTY] + || node._dh3bpState || "" ); } @@ -236,9 +236,9 @@ function writeState(node, state) { } function syncStateFromNode(node) { - const widgetValue = findWidget(node, HIDDEN_INPUT_NAME)?.value; const propertyValue = node.properties?.[STATE_PROPERTY]; - const source = node._dh3bpState || widgetValue || propertyValue || ""; + const widgetValue = findWidget(node, HIDDEN_INPUT_NAME)?.value; + const source = propertyValue || widgetValue || node._dh3bpState || ""; writeState(node, source); }