Revert "wip"

This reverts commit 5a2990a2fa.
This commit is contained in:
ThatOneCalculator 2023-01-19 16:24:53 -08:00
parent 680159c109
commit da704f341d
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 17 additions and 8 deletions

View file

@ -90,7 +90,6 @@ 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 = [];
@ -345,14 +344,10 @@ 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 }" :pagination="dmsPagination">
<MkPagination v-slot="{ items }" ref="paginationComponentUser" :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 }" :pagination="groupsPagination">
<MkPagination v-slot="{ items }" ref="paginationComponentGroup" :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 } from 'vue';
import { markRaw, onMounted, onUnmounted, watch, computed, onActivated, onDeactivated } from 'vue';
import * as Acct from 'calckey-js/built/acct';
import { Virtual } from 'swiper';
import { Swiper, SwiperSlide } from 'swiper/vue';
@ -212,6 +212,20 @@ 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>