Scroll status into view on reply

Signed-off-by: Louis Chemineau <louis@chmn.me>
pull/1696/head
Louis Chemineau 2023-03-22 19:37:49 +01:00
rodzic 14ab49b5c6
commit 738204123c
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
<template>
<div class="post-content">
<div class="post-content" :data-social-status="item.id">
<div class="post-header">
<div class="post-author-wrapper" :title="item.account.acct">
<router-link v-if="item.account"

Wyświetl plik

@ -74,7 +74,7 @@ export default {
// Make sure to scroll mainPost into view on first load so it is not hidden after the parents.
parentsTimeline(_, previousValue) {
if (previousValue.length === 0 && this.$refs.socialWrapper.parentElement.scrollTop === 0) {
this.$nextTick(() => this.$refs.mainPost.$el.scrollIntoView())
this.$nextTick(() => this.$refs.mainPost.$el.scrollIntoView({ behavior: 'smooth', block: 'center' }))
}
},
},
@ -91,6 +91,12 @@ export default {
},
})
this.$root.$on('composer-reply', (item) => {
this.$nextTick(() => {
this.$refs.socialWrapper.querySelector(`[data-social-status="${item.id}"]`).scrollIntoView({ behavior: 'smooth', block: 'center' })
})
})
// Fetch information of the related account
const response = await this.$store.dispatch(this.serverData.public ? 'fetchPublicAccountInfo' : 'fetchAccountInfo', this.account)
// We need to update this.uid because we may have asked info for an account whose domain part was a host-meta,