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
}, {
forest: {},
forest: {}
})
debug('threads = ', threads)
@ -217,7 +217,7 @@ const conversation = {
topLevel () {
const topLevel = this.conversation.reduce((tl, cur) =>
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
},
showingTopLevel () {
@ -282,7 +282,6 @@ const conversation = {
statusContentProperties () {
return this.conversation.reduce((a, k) => {
const id = k.id
const depth = this.depths[id]
const props = (() => {
if (this.statusContentPropertiesObject[id]) {
return this.statusContentPropertiesObject[id]
@ -290,7 +289,7 @@ const conversation = {
return {
showingTall: false,
expandingSubject: false,
showingLongSubject: false,
showingLongSubject: false
}
})()
@ -448,7 +447,7 @@ const conversation = {
cur = this.parentOf(cur)
}
// nothing found, fall back to toplevel
return topLevel[0].id
return this.topLevel[0] ? this.topLevel[0].id : undefined
},
diveIntoStatus (id, preventScroll) {
this.diveHistory = [...this.diveHistory, id]
@ -473,6 +472,9 @@ const conversation = {
}
},
tryScrollTo (id) {
if (!id) {
return
}
if (this.isPage) {
// set statusId
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 camelized = camelCase(name)
const toggle = `controlledToggle${camelized}`
const controlledName = `controlled${camelized}`
const uncontrolledName = `uncontrolled${camelized}`
if (obj[toggle]) {
obj[toggle]()