From cf2be1be63e262d0c0352aac6508f7d9c8e1d9a1 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 27 May 2018 14:55:42 -0400 Subject: [PATCH] fix bind:online in dev mode (#1502) --- src/compile/nodes/Window.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compile/nodes/Window.ts b/src/compile/nodes/Window.ts index 6651fce854..6a7988738e 100644 --- a/src/compile/nodes/Window.ts +++ b/src/compile/nodes/Window.ts @@ -200,7 +200,9 @@ export default class Window extends Node { const handlerName = block.getUniqueName(`onlinestatuschanged`); block.builders.init.addBlock(deindent` function ${handlerName}(event) { + ${compiler.options.dev && `component._updatingReadonlyProperty = true;`} #component.set({ ${bindings.online}: navigator.onLine }); + ${compiler.options.dev && `component._updatingReadonlyProperty = false;`} } window.addEventListener("online", ${handlerName}); window.addEventListener("offline", ${handlerName});