From 48f1a9a1ff170f7e7c73e5924c158bc136feba03 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 6 Jan 2019 19:06:33 -0500 Subject: [PATCH] snapshot --- src/compile/render-dom/Block.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compile/render-dom/Block.ts b/src/compile/render-dom/Block.ts index f976f2cf29..524fda9c65 100644 --- a/src/compile/render-dom/Block.ts +++ b/src/compile/render-dom/Block.ts @@ -221,8 +221,8 @@ export default class Block { if (this.hasIntroMethod || this.hasOutroMethod) { this.addVariable('#current'); - if (!this.builders.mount.isEmpty()) { - this.builders.mount.addLine(`#current = true;`); + if (!this.builders.intro.isEmpty()) { + this.builders.intro.addLine(`#current = true;`); } if (!this.builders.outro.isEmpty()) { @@ -352,6 +352,7 @@ export default class Block { } else { properties.addBlock(deindent` ${dev ? 'i: function intro' : 'i'}() { + if (#current) return; ${this.builders.intro} }, `); @@ -362,6 +363,7 @@ export default class Block { } else { properties.addBlock(deindent` ${dev ? 'o: function outro' : 'o'}() { + if (#current === false) return; ${this.builders.outro} }, `);