refs #601 Fix losting focused toot in timeline
This commit is contained in:
parent
0094915feb
commit
2d2aa38416
@ -55,7 +55,15 @@ export default {
|
|||||||
'modalOpened'
|
'modalOpened'
|
||||||
]),
|
]),
|
||||||
shortcutEnabled: function () {
|
shortcutEnabled: function () {
|
||||||
return !this.focusedId && !this.modalOpened
|
if (this.modalOpened) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.focusedId) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Sometimes toots are deleted, so perhaps focused toot don't exist.
|
||||||
|
const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri)
|
||||||
|
return currentIndex === -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
@ -55,7 +55,15 @@ export default {
|
|||||||
'modalOpened'
|
'modalOpened'
|
||||||
]),
|
]),
|
||||||
shortcutEnabled: function () {
|
shortcutEnabled: function () {
|
||||||
return !this.focusedId && !this.modalOpened
|
if (this.modalOpened) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.focusedId) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Sometimes toots are deleted, so perhaps focused toot don't exist.
|
||||||
|
const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri)
|
||||||
|
return currentIndex === -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
@ -55,7 +55,15 @@ export default {
|
|||||||
'modalOpened'
|
'modalOpened'
|
||||||
]),
|
]),
|
||||||
shortcutEnabled: function () {
|
shortcutEnabled: function () {
|
||||||
return !this.focusedId && !this.modalOpened
|
if (this.modalOpened) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.focusedId) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Sometimes toots are deleted, so perhaps focused toot don't exist.
|
||||||
|
const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri)
|
||||||
|
return currentIndex === -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
@ -55,7 +55,15 @@ export default {
|
|||||||
'modalOpened'
|
'modalOpened'
|
||||||
]),
|
]),
|
||||||
shortcutEnabled: function () {
|
shortcutEnabled: function () {
|
||||||
return !this.focusedId && !this.modalOpened
|
if (this.modalOpened) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.focusedId) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Sometimes toots are deleted, so perhaps focused toot don't exist.
|
||||||
|
const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri)
|
||||||
|
return currentIndex === -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
@ -55,7 +55,15 @@ export default {
|
|||||||
'modalOpened'
|
'modalOpened'
|
||||||
]),
|
]),
|
||||||
shortcutEnabled: function () {
|
shortcutEnabled: function () {
|
||||||
return !this.focusedId && !this.modalOpened
|
if (this.modalOpened) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.focusedId) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Sometimes toots are deleted, so perhaps focused toot don't exist.
|
||||||
|
const currentIndex = this.timeline.findIndex(toot => this.focusedId === toot.uri)
|
||||||
|
return currentIndex === -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user