From dc86b08c94bde9ed173125665a51ace108d12fac Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Fri, 5 Oct 2018 23:57:16 +0900 Subject: [PATCH] Fix message id in timeline --- .../TimelineSpace/Contents/Hashtag/Tag.vue | 20 ++++++++-------- .../TimelineSpace/Contents/Home.vue | 20 ++++++++-------- .../TimelineSpace/Contents/Lists/Show.vue | 20 ++++++++-------- .../TimelineSpace/Contents/Local.vue | 23 ++++++++----------- .../TimelineSpace/Contents/Public.vue | 20 ++++++++-------- 5 files changed, 50 insertions(+), 53 deletions(-) diff --git a/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue b/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue index ccec78b8..d6b4b61f 100644 --- a/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue +++ b/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue @@ -4,11 +4,11 @@
-
+
this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) return currentIndex === -1 } }, @@ -200,28 +200,28 @@ export default { this.focusedId = null }, focusNext () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === -1) { - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id } else if (currentIndex < this.timeline.length) { - this.focusedId = this.timeline[currentIndex + 1].uri + this.focusedId = this.timeline[currentIndex + 1].uri + this.timeline[currentIndex + 1].id } }, focusPrev () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === 0) { this.focusedId = null } else if (currentIndex > 0) { - this.focusedId = this.timeline[currentIndex - 1].uri + this.focusedId = this.timeline[currentIndex - 1].uri + this.timeline[currentIndex - 1].id } }, focusToot (message) { - this.focusedId = message.uri + this.focusedId = message.uri + message.id }, handleKey (event) { switch (event.srcKey) { case 'next': - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id break } } diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue index e802477b..3bc2dd15 100644 --- a/src/renderer/components/TimelineSpace/Contents/Home.vue +++ b/src/renderer/components/TimelineSpace/Contents/Home.vue @@ -4,11 +4,11 @@
-
+
this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) return currentIndex === -1 } }, @@ -170,28 +170,28 @@ export default { this.focusedId = null }, focusNext () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === -1) { - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id } else if (currentIndex < this.timeline.length) { - this.focusedId = this.timeline[currentIndex + 1].uri + this.focusedId = this.timeline[currentIndex + 1].uri + this.timeline[currentIndex + 1].id } }, focusPrev () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === 0) { this.focusedId = null } else if (currentIndex > 0) { - this.focusedId = this.timeline[currentIndex - 1].uri + this.focusedId = this.timeline[currentIndex - 1].uri + this.timeline[currentIndex - 1].id } }, focusToot (message) { - this.focusedId = message.uri + this.focusedId = message.uri + message.id }, handleKey (event) { switch (event.srcKey) { case 'next': - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id break } } diff --git a/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue b/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue index ec5c19b9..88db3aa7 100644 --- a/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue +++ b/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue @@ -4,11 +4,11 @@
-
+
this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) return currentIndex === -1 } }, @@ -199,28 +199,28 @@ export default { this.focusedId = null }, focusNext () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === -1) { - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id } else if (currentIndex < this.timeline.length) { - this.focusedId = this.timeline[currentIndex + 1].uri + this.focusedId = this.timeline[currentIndex + 1].uri + this.timeline[currentIndex + 1].id } }, focusPrev () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === 0) { this.focusedId = null } else if (currentIndex > 0) { - this.focusedId = this.timeline[currentIndex - 1].uri + this.focusedId = this.timeline[currentIndex - 1].uri + this.timeline[currentIndex - 1].id } }, focusToot (message) { - this.focusedId = message.uri + this.focusedId = message.uri + message.id }, handleKey (event) { switch (event.srcKey) { case 'next': - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id break } } diff --git a/src/renderer/components/TimelineSpace/Contents/Local.vue b/src/renderer/components/TimelineSpace/Contents/Local.vue index 2f12354f..f15e6dcc 100644 --- a/src/renderer/components/TimelineSpace/Contents/Local.vue +++ b/src/renderer/components/TimelineSpace/Contents/Local.vue @@ -4,11 +4,11 @@
-
+
this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) return currentIndex === -1 } }, @@ -94,7 +94,6 @@ export default { } }, focusedId: function (newState, oldState) { - console.log(newState) if (newState && this.heading) { this.$store.commit('TimelineSpace/Contents/Local/changeHeading', false) } else if (newState === null && !this.heading) { @@ -170,30 +169,28 @@ export default { this.focusedId = null }, focusNext () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) - console.log(currentIndex) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === -1) { - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id } else if (currentIndex < this.timeline.length) { - this.focusedId = this.timeline[currentIndex + 1].uri + this.focusedId = this.timeline[currentIndex + 1].uri + this.timeline[currentIndex + 1].id } }, focusPrev () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === 0) { this.focusedId = null } else if (currentIndex > 0) { - this.focusedId = this.timeline[currentIndex - 1].uri + this.focusedId = this.timeline[currentIndex - 1].uri + this.timeline[currentIndex - 1].id } }, focusToot (message) { - this.focusedId = message.uri - console.log(this.focusedId) + this.focusedId = message.uri + message.id }, handleKey (event) { switch (event.srcKey) { case 'next': - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id break } } diff --git a/src/renderer/components/TimelineSpace/Contents/Public.vue b/src/renderer/components/TimelineSpace/Contents/Public.vue index 1f4056df..e43cd22b 100644 --- a/src/renderer/components/TimelineSpace/Contents/Public.vue +++ b/src/renderer/components/TimelineSpace/Contents/Public.vue @@ -4,11 +4,11 @@
-
+
this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) return currentIndex === -1 } }, @@ -192,28 +192,28 @@ export default { this.focusedId = null }, focusNext () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === -1) { - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id } else if (currentIndex < this.timeline.length) { - this.focusedId = this.timeline[currentIndex + 1].uri + this.focusedId = this.timeline[currentIndex + 1].uri + this.timeline[currentIndex + 1].id } }, focusPrev () { - const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri) + const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri + toot.id) if (currentIndex === 0) { this.focusedId = null } else if (currentIndex > 0) { - this.focusedId = this.timeline[currentIndex - 1].uri + this.focusedId = this.timeline[currentIndex - 1].uri + this.timeline[currentIndex - 1].id } }, focusToot (message) { - this.focusedId = message.uri + this.focusedId = message.uri + message.id }, handleKey (event) { switch (event.srcKey) { case 'next': - this.focusedId = this.timeline[0].uri + this.focusedId = this.timeline[0].uri + this.timeline[0].id break } }