From cadce52e1bd1b9f89d22da95aa580e6959e4255a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 2 Feb 2024 11:28:54 +0000 Subject: [PATCH] Changing how optional decoding works. --- .../automation/SetupPanel/AutomationBlockSetup.svelte | 2 +- packages/builder/src/components/common/bindings/utils.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index d8b41dc94d..213e1e0e54 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -585,7 +585,7 @@ binding, { js: true, - decode: false, + dontDecode: true, } )} mode="javascript" diff --git a/packages/builder/src/components/common/bindings/utils.js b/packages/builder/src/components/common/bindings/utils.js index 428e092842..a086cd0394 100644 --- a/packages/builder/src/components/common/bindings/utils.js +++ b/packages/builder/src/components/common/bindings/utils.js @@ -9,11 +9,11 @@ export class BindingHelpers { } // Adds a JS/HBS helper to the expression - onSelectHelper(value, helper, { js }) { + onSelectHelper(value, helper, { js, dontDecode }) { const pos = this.getCaretPosition() const { start, end } = pos if (js) { - const jsVal = decodeJSBinding(value) + const jsVal = dontDecode ? value : decodeJSBinding(value) const insertVal = jsInsert(jsVal, start, end, helper.text, { helper: true, }) @@ -25,10 +25,10 @@ export class BindingHelpers { } // Adds a data binding to the expression - onSelectBinding(value, binding, { js, decode }) { + onSelectBinding(value, binding, { js, dontDecode }) { const { start, end } = this.getCaretPosition() if (js) { - const jsVal = decode ? decodeJSBinding(value) : value + const jsVal = dontDecode ? value : decodeJSBinding(value) const insertVal = jsInsert(jsVal, start, end, binding.readableBinding, { disableWrapping: this.disableWrapping, })