fix null in Timeline.html get() (#205)

This commit is contained in:
Nolan Lawson 2018-04-21 09:56:45 -07:00 committed by GitHub
parent 78f44c7b51
commit 1151a3be4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 13 deletions

View file

@ -59,14 +59,14 @@
// perf improves for input responsiveness
this.observe('composeSelectionStart', () => {
scheduleIdleTask(() => {
let { composeSelectionStart } = this.get() || {} // TODO: wtf svelte?
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() || {} // TODO: wtf svelte?
let { composeFocused } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
this.set({composeFocusedDeferred: composeFocused})
})
}

View file

@ -31,7 +31,7 @@
this.observe('lengthAsFraction', () => {
scheduleIdleTask(() => {
mark('set lengthAsFractionDeferred')
let { lengthAsFraction } = this.get() || {} // TODO: wtf svelte?
let { lengthAsFraction } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
this.set({lengthAsFractionDeferred: lengthAsFraction})
stop('set lengthAsFractionDeferred')
requestAnimationFrame(() => this.set({shouldAnimate: true}))

View file

@ -29,7 +29,7 @@
this.observe('lengthToDisplay', () => {
scheduleIdleTask(() => {
mark('set lengthToDisplayDeferred')
let { lengthToDisplay } = this.get() || {} // TODO: wtf svelte?
let { lengthToDisplay } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
this.set({lengthToDisplayDeferred: lengthToDisplay})
stop('set lengthToDisplayDeferred')
})

View file

@ -26,7 +26,7 @@
// unrender lazily; it's not a critical UI task
scheduleIdleTask(() => {
mark('unrender')
let { isIntersecting } = this.get() || {} // TODO: wtf svelte?
let { isIntersecting } = this.get() || {} // https://github.com/sveltejs/svelte/issues/1354
if (!isIntersecting) {
this.set({hide: true})
}

View file

@ -166,13 +166,12 @@
this.set({scrollTop: scrollTop})
},
onScrollToBottom () {
let {
timelineInitialized,
runningUpdate
} = this.store.get()
let {
timelineType
} = this.get()
let state = this.store.get()
if (!state) {
return // https://github.com/sveltejs/svelte/issues/1354
}
let { timelineType } = state
let { timelineInitialized, runningUpdate } = this.store.get()
if (!timelineInitialized ||
runningUpdate ||
timelineType === 'status') { // for status contexts, we've already fetched the whole thread
@ -198,7 +197,7 @@
let { currentInstance } = this.store.get()
let { timeline } = this.get()
let handleItemIdsToAdd = () => {
let { itemIdsToAdd } = this.get() || {} // TODO: wtf svelte?
let { itemIdsToAdd } = this.get() || {} // // https://github.com/sveltejs/svelte/issues/1354
if (!itemIdsToAdd || !itemIdsToAdd.length) {
return
}