This commit is contained in:
cutestnekoaqua 2023-01-19 18:28:07 +01:00
parent 66448b5e52
commit 5a2990a2fa
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0
2 changed files with 8 additions and 17 deletions

View File

@ -90,6 +90,7 @@ const backed = ref(false); // 遡り中か否か
const isBackTop = ref(false);
const empty = computed(() => items.value.length === 0);
const error = ref(false);
const alreadyInitedOnce = ref(false);
const init = async (): Promise<void> => {
queue.value = [];
@ -344,10 +345,14 @@ init();
onActivated(() => {
isBackTop.value = false;
if(alreadyInitedOnce.value) {
reload();
}
});
onDeactivated(() => {
isBackTop.value = window.scrollY === 0;
alreadyInitedOnce.value = true;
});
defineExpose({

View File

@ -13,7 +13,7 @@
<MkButton primary class="start" @click="startUser"><i class="ph-plus-bold ph-lg"></i> {{
i18n.ts.startMessaging
}}</MkButton>
<MkPagination v-slot="{ items }" ref="paginationComponentUser" :pagination="dmsPagination">
<MkPagination v-slot="{ items }" :pagination="dmsPagination">
<MkChatPreview v-for="message in items" :key="message.id" class="yweeujhr message _block"
:message="message" />
</MkPagination>
@ -28,7 +28,7 @@
i18n.ts.startMessaging
}}</MkButton>
</div>
<MkPagination v-slot="{ items }" ref="paginationComponentGroup" :pagination="groupsPagination">
<MkPagination v-slot="{ items }" :pagination="groupsPagination">
<MkChatPreview v-for="message in items" :key="message.id" class="yweeujhr message _block"
:message="message" />
</MkPagination>
@ -41,7 +41,7 @@
</template>
<script lang="ts" setup>
import { markRaw, onMounted, onUnmounted, watch, computed, onActivated, onDeactivated } from 'vue';
import { markRaw, onMounted, onUnmounted, watch, computed } from 'vue';
import * as Acct from 'calckey-js/built/acct';
import { Virtual } from 'swiper';
import { Swiper, SwiperSlide } from 'swiper/vue';
@ -212,20 +212,6 @@ onMounted(() => {
onUnmounted(() => {
if (connection) connection.dispose();
});
// temporary hot fix of the temporary hot fix
let alreadyInit = $ref(false);
onActivated(() => {
if (alreadyInit.value) {
paginationComponentUser.reload();
paginationComponentGroup.reload();
}
});
onDeactivated(() => {
alreadyInit.value = true;
});
</script>
<style lang="scss" scoped>