From a88fb705420c3037a4c9089d6c85f6f49677cee7 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 4 May 2018 20:09:20 -0700 Subject: [PATCH] remove unnecessary sveltejs/svelte#1354 workarounds (#269) --- routes/_components/compose/ComposeAutosuggest.html | 4 ++-- routes/_components/compose/ComposeLengthGauge.html | 2 +- routes/_components/compose/ComposeLengthIndicator.html | 2 +- .../pseudoVirtualList/PseudoVirtualListItem.html | 2 +- .../pseudoVirtualList/PseudoVirtualListLazyItem.html | 2 +- routes/_components/timeline/Timeline.html | 8 ++------ routes/_components/virtualList/VirtualListLazyItem.html | 2 +- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/routes/_components/compose/ComposeAutosuggest.html b/routes/_components/compose/ComposeAutosuggest.html index de6544955..e7c6a9f9c 100644 --- a/routes/_components/compose/ComposeAutosuggest.html +++ b/routes/_components/compose/ComposeAutosuggest.html @@ -60,14 +60,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() 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() this.set({composeFocusedDeferred: composeFocused}) }) } diff --git a/routes/_components/compose/ComposeLengthGauge.html b/routes/_components/compose/ComposeLengthGauge.html index e6e3883c3..fc8e12202 100644 --- a/routes/_components/compose/ComposeLengthGauge.html +++ b/routes/_components/compose/ComposeLengthGauge.html @@ -32,7 +32,7 @@ this.observe('lengthAsFraction', () => { scheduleIdleTask(() => { mark('set lengthAsFractionDeferred') - let { lengthAsFraction } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 + let { lengthAsFraction } = this.get() this.set({lengthAsFractionDeferred: lengthAsFraction}) stop('set lengthAsFractionDeferred') requestAnimationFrame(() => this.set({shouldAnimate: true})) diff --git a/routes/_components/compose/ComposeLengthIndicator.html b/routes/_components/compose/ComposeLengthIndicator.html index efc109678..204a0cc18 100644 --- a/routes/_components/compose/ComposeLengthIndicator.html +++ b/routes/_components/compose/ComposeLengthIndicator.html @@ -30,7 +30,7 @@ this.observe('lengthToDisplay', () => { scheduleIdleTask(() => { mark('set lengthToDisplayDeferred') - let { lengthToDisplay } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 + let { lengthToDisplay } = this.get() this.set({lengthToDisplayDeferred: lengthToDisplay}) stop('set lengthToDisplayDeferred') }) diff --git a/routes/_components/pseudoVirtualList/PseudoVirtualListItem.html b/routes/_components/pseudoVirtualList/PseudoVirtualListItem.html index 1c9b38b3f..1a235c810 100644 --- a/routes/_components/pseudoVirtualList/PseudoVirtualListItem.html +++ b/routes/_components/pseudoVirtualList/PseudoVirtualListItem.html @@ -27,7 +27,7 @@ // unrender lazily; it's not a critical UI task scheduleIdleTask(() => { mark('unrender') - let { isIntersecting } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 + let { isIntersecting } = this.get() if (!isIntersecting) { this.set({hide: true}) } diff --git a/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html b/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html index f382ed109..743d4299c 100644 --- a/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html +++ b/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html @@ -17,7 +17,7 @@ export default { async oncreate () { - let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 + let { makeProps, key } = this.get() 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 f662f1cb7..ec81c456a 100644 --- a/routes/_components/timeline/Timeline.html +++ b/routes/_components/timeline/Timeline.html @@ -169,11 +169,7 @@

{label}

this.set({scrollTop: scrollTop}) }, onScrollToBottom () { - let state = this.store.get() - if (!state) { - return // https://github.com/sveltejs/svelte/issues/1354 - } - let { timelineType } = state + let { timelineType } = this.store.get() let { timelineInitialized, runningUpdate } = this.store.get() if (!timelineInitialized || runningUpdate || @@ -200,7 +196,7 @@

{label}

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() if (!itemIdsToAdd || !itemIdsToAdd.length) { return } diff --git a/routes/_components/virtualList/VirtualListLazyItem.html b/routes/_components/virtualList/VirtualListLazyItem.html index 653b02999..3aa837cd6 100644 --- a/routes/_components/virtualList/VirtualListLazyItem.html +++ b/routes/_components/virtualList/VirtualListLazyItem.html @@ -12,7 +12,7 @@ export default { async oncreate () { - let { makeProps, key } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354 + let { makeProps, key } = this.get() if (makeProps) { let props = await makeProps(key) mark('VirtualListLazyItem set props')