+
@@ -35,7 +35,7 @@ export default {
data () {
return {
heading: true,
- focusedIndex: null
+ focusedId: null
}
},
computed: {
@@ -81,7 +81,7 @@ export default {
}
},
focusedIndex: function (newState, oldState) {
- if (newState >= 0 && this.heading) {
+ if (newState && this.heading) {
this.heading = false
} else if (newState === null && !this.heading) {
this.heading = true
@@ -147,24 +147,26 @@ export default {
document.getElementById('scrollable'),
0
)
- this.focusedIndex = null
+ this.focusedId = null
},
focusNext () {
- if (this.focusedIndex === null) {
- this.focusedIndex = 0
- } else if (this.focusedIndex < this.favourites.length) {
- this.focusedIndex++
+ const currentIndex = this.favourites.findIndex(toot => this.focusedId === toot.uri)
+ if (currentIndex === -1) {
+ this.focusedId = this.favourites[0].uri
+ } else if (currentIndex < this.favourites.length) {
+ this.focusedId = this.favourites[currentIndex + 1].uri
}
},
focusPrev () {
- if (this.focusedIndex === 0) {
- this.focusedIndex = null
- } else if (this.focusedIndex > 0) {
- this.focusedIndex--
+ const currentIndex = this.favourites.findIndex(toot => this.focusedId === toot.uri)
+ if (currentIndex === 0) {
+ this.focusedId = null
+ } else if (currentIndex > 0) {
+ this.focusedId = this.favourites[currentIndex - 1].uri
}
},
- focusToot (index) {
- this.focusedIndex = index
+ focusToot (message) {
+ this.focusedId = message.id
}
}
}
diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue
index 2471bb3d..1eac656c 100644
--- a/src/renderer/components/TimelineSpace/Contents/Home.vue
+++ b/src/renderer/components/TimelineSpace/Contents/Home.vue
@@ -4,7 +4,7 @@
-