forked from cybrespace/pinafore
fix null in Timeline.html get() (#205)
This commit is contained in:
parent
78f44c7b51
commit
1151a3be4b
|
@ -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})
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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}))
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
|
|
|
@ -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})
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue