This commit is contained in:
Tusooa Zhu 2021-08-07 18:59:48 -04:00
parent 05b2351e08
commit 0aaef50ee5
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
2 changed files with 7 additions and 6 deletions

View file

@ -146,7 +146,7 @@ const conversation = {
return a return a
}, { }, {
forest: {}, forest: {}
}) })
debug('threads = ', threads) debug('threads = ', threads)
@ -217,7 +217,7 @@ const conversation = {
topLevel () { topLevel () {
const topLevel = this.conversation.reduce((tl, cur) => const topLevel = this.conversation.reduce((tl, cur) =>
tl.filter(k => this.getReplies(cur.id).map(v => v.id).indexOf(k.id) === -1), this.conversation) tl.filter(k => this.getReplies(cur.id).map(v => v.id).indexOf(k.id) === -1), this.conversation)
debug("toplevel =", topLevel) debug('toplevel =', topLevel)
return topLevel return topLevel
}, },
showingTopLevel () { showingTopLevel () {
@ -282,7 +282,6 @@ const conversation = {
statusContentProperties () { statusContentProperties () {
return this.conversation.reduce((a, k) => { return this.conversation.reduce((a, k) => {
const id = k.id const id = k.id
const depth = this.depths[id]
const props = (() => { const props = (() => {
if (this.statusContentPropertiesObject[id]) { if (this.statusContentPropertiesObject[id]) {
return this.statusContentPropertiesObject[id] return this.statusContentPropertiesObject[id]
@ -290,7 +289,7 @@ const conversation = {
return { return {
showingTall: false, showingTall: false,
expandingSubject: false, expandingSubject: false,
showingLongSubject: false, showingLongSubject: false
} }
})() })()
@ -448,7 +447,7 @@ const conversation = {
cur = this.parentOf(cur) cur = this.parentOf(cur)
} }
// nothing found, fall back to toplevel // nothing found, fall back to toplevel
return topLevel[0].id return this.topLevel[0] ? this.topLevel[0].id : undefined
}, },
diveIntoStatus (id, preventScroll) { diveIntoStatus (id, preventScroll) {
this.diveHistory = [...this.diveHistory, id] this.diveHistory = [...this.diveHistory, id]
@ -473,6 +472,9 @@ const conversation = {
} }
}, },
tryScrollTo (id) { tryScrollTo (id) {
if (!id) {
return
}
if (this.isPage) { if (this.isPage) {
// set statusId // set statusId
this.$router.push({ name: 'conversation', params: { id } }) this.$router.push({ name: 'conversation', params: { id } })

View file

@ -39,7 +39,6 @@ const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
const controlledOrUncontrolledToggle = (obj, name) => { const controlledOrUncontrolledToggle = (obj, name) => {
const camelized = camelCase(name) const camelized = camelCase(name)
const toggle = `controlledToggle${camelized}` const toggle = `controlledToggle${camelized}`
const controlledName = `controlled${camelized}`
const uncontrolledName = `uncontrolled${camelized}` const uncontrolledName = `uncontrolled${camelized}`
if (obj[toggle]) { if (obj[toggle]) {
obj[toggle]() obj[toggle]()