From 40a9ff957a4cabd8293b310cd5357fd827ded890 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 29 Apr 2018 17:33:58 -0700 Subject: [PATCH] fix null error in virtual list items (#239) --- routes/_components/compose/ComposeAutosuggest.html | 4 ++-- routes/_components/compose/ComposeLengthIndicator.html | 2 +- .../pseudoVirtualList/PseudoVirtualListLazyItem.html | 4 +--- routes/_components/timeline/Timeline.html | 2 +- routes/_components/virtualList/VirtualListLazyItem.html | 4 +--- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/routes/_components/compose/ComposeAutosuggest.html b/routes/_components/compose/ComposeAutosuggest.html index 8918640..4736790 100644 --- a/routes/_components/compose/ComposeAutosuggest.html +++ b/routes/_components/compose/ComposeAutosuggest.html @@ -59,14 +59,14 @@ // perf improves for input responsiveness this.observe('composeSelectionStart', () => { scheduleIdleTask(() => { - let { composeSelectionStart } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354 + let { composeSelectionStart } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 this.set({composeSelectionStartDeferred: composeSelectionStart}) }) }) this.observe('composeFocused', (composeFocused) => { let updateFocusedState = () => { scheduleIdleTask(() => { - let { composeFocused } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354 + let { composeFocused } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 this.set({composeFocusedDeferred: composeFocused}) }) } diff --git a/routes/_components/compose/ComposeLengthIndicator.html b/routes/_components/compose/ComposeLengthIndicator.html index d09afb6..3e62b41 100644 --- a/routes/_components/compose/ComposeLengthIndicator.html +++ b/routes/_components/compose/ComposeLengthIndicator.html @@ -29,7 +29,7 @@ this.observe('lengthToDisplay', () => { scheduleIdleTask(() => { mark('set lengthToDisplayDeferred') - let { lengthToDisplay } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354 + let { lengthToDisplay } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 this.set({lengthToDisplayDeferred: lengthToDisplay}) stop('set lengthToDisplayDeferred') }) diff --git a/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html b/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html index 2aba891..964cbe1 100644 --- a/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html +++ b/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html @@ -17,9 +17,7 @@ export default { async oncreate () { - // TODO: there appears to be a bug in {{#await}} that means we have to do this manually. - // Some items may appear on top of other items because their offset is 0 and never updated. - let { makeProps, key } = this.get() + let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 if (makeProps) { let props = await makeProps(key) mark('PseudoVirtualListLazyItem set props') diff --git a/routes/_components/timeline/Timeline.html b/routes/_components/timeline/Timeline.html index 8d1a44d..6e96599 100644 --- a/routes/_components/timeline/Timeline.html +++ b/routes/_components/timeline/Timeline.html @@ -197,7 +197,7 @@ let { currentInstance } = this.store.get() let { timeline } = this.get() let handleItemIdsToAdd = () => { - let { itemIdsToAdd } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354 + let { itemIdsToAdd } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 if (!itemIdsToAdd || !itemIdsToAdd.length) { return } diff --git a/routes/_components/virtualList/VirtualListLazyItem.html b/routes/_components/virtualList/VirtualListLazyItem.html index 751cf1b..3e0e6ab 100644 --- a/routes/_components/virtualList/VirtualListLazyItem.html +++ b/routes/_components/virtualList/VirtualListLazyItem.html @@ -12,9 +12,7 @@ export default { async oncreate () { - // TODO: there appears to be a bug in {{#await}} that means we have to do this manually. - // Some items may appear on top of other items because their offset is 0 and never updated. - let { makeProps, key } = this.get() + let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 if (makeProps) { let props = await makeProps(key) mark('VirtualListLazyItem set props')