From 0aaef50ee5decd5c735e08c8193c6fb8caf2d2e2 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 7 Aug 2021 18:59:48 -0400 Subject: [PATCH] Lint --- src/components/conversation/conversation.js | 12 +++++++----- src/components/status_content/status_content.js | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index a1991888..95525dc1 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -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 } }) diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js index 65ec85c4..527a4cf5 100644 --- a/src/components/status_content/status_content.js +++ b/src/components/status_content/status_content.js @@ -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]()