Merge branch 'virtual-scrolling-2.0' into shigusegubu-themes3

This commit is contained in:
Henry Jameson 2026-09-10 19:17:25 +03:00
commit d7d4105d65
2 changed files with 8 additions and 4 deletions

View file

@ -83,7 +83,7 @@ export default {
router.push({ name: 'conversation', params: { statusId: id } }) router.push({ name: 'conversation', params: { statusId: id } })
} }
setFocused(id) setFocused(id)
const target = document.querySelector(`.Status[data-status-id=${id}]`) const target = document.querySelector(`.Status[data-status-id="${id}"]`)
return await scroller.scrollIntoView(target, { block: 'nearest' }) return await scroller.scrollIntoView(target, { block: 'nearest' })
} }

View file

@ -597,13 +597,17 @@ const Status = {
}) })
}, },
}, },
mounted() {
this.resizeObserver.observe(this.$el)
},
unmounted() { unmounted() {
this.resizeObserver.disconnect() this.resizeObserver.disconnect()
}, },
watch: { watch: {
'$refs.root': function (element) {
if (element) {
this.resizeObserver.observe(this.$refs.root)
} else {
this.resizeObserver.disconnect()
}
},
'mainStatus.repeat_num': function (num) { 'mainStatus.repeat_num': function (num) {
// refetch repeats when repeat_num is changed in any way // refetch repeats when repeat_num is changed in any way
if (this.focused && this.repeatedBy.size !== num) { if (this.focused && this.repeatedBy.size !== num) {