Fix: use let to prevent reassignment error for sandbox result (#1067)

In the sandbox/sandbox example, a variable `result` is created as a const, but it's attempted to be reassigned later in the code.  This changeset just changes the `result` variable to be a reassignable variable instead.
This commit is contained in:
Stephen Kao
2024-01-10 08:30:22 -05:00
committed by GitHub
parent 578c684d3e
commit 77897c576d

View File

@@ -57,8 +57,8 @@ limitations under the License.
// Set up message event handler:
window.addEventListener('message', function (event) {
const command = event.data.command;
const template = templates[event.data.templateName],
result = 'invalid request';
const template = templates[event.data.templateName];
let result = 'invalid request';
// if we don't know the templateName requested, return an error message
if (template) {