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 isBackTop = ref(false);
const empty = computed(() => items.value.length === 0); const empty = computed(() => items.value.length === 0);
const error = ref(false); const error = ref(false);
const alreadyInitedOnce = ref(false);
const init = async (): Promise<void> => { const init = async (): Promise<void> => {
queue.value = []; queue.value = [];
@ -345,14 +344,10 @@ init();
onActivated(() => { onActivated(() => {
isBackTop.value = false; isBackTop.value = false;
if(alreadyInitedOnce.value) {
reload();
}
}); });
onDeactivated(() => { onDeactivated(() => {
isBackTop.value = window.scrollY === 0; isBackTop.value = window.scrollY === 0;
alreadyInitedOnce.value = true;
}); });
defineExpose({ defineExpose({

View File

@ -13,7 +13,7 @@
<MkButton primary class="start" @click="startUser"><i class="ph-plus-bold ph-lg"></i> {{ <MkButton primary class="start" @click="startUser"><i class="ph-plus-bold ph-lg"></i> {{
i18n.ts.startMessaging i18n.ts.startMessaging
}}</MkButton> }}</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" <MkChatPreview v-for="message in items" :key="message.id" class="yweeujhr message _block"
:message="message" /> :message="message" />
</MkPagination> </MkPagination>
@ -28,7 +28,7 @@
i18n.ts.startMessaging i18n.ts.startMessaging
}}</MkButton> }}</MkButton>
</div> </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" <MkChatPreview v-for="message in items" :key="message.id" class="yweeujhr message _block"
:message="message" /> :message="message" />
</MkPagination> </MkPagination>
@ -41,7 +41,7 @@
</template> </template>
<script lang="ts" setup> <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 * as Acct from 'calckey-js/built/acct';
import { Virtual } from 'swiper'; import { Virtual } from 'swiper';
import { Swiper, SwiperSlide } from 'swiper/vue'; import { Swiper, SwiperSlide } from 'swiper/vue';
@ -212,6 +212,20 @@ onMounted(() => {
onUnmounted(() => { onUnmounted(() => {
if (connection) connection.dispose(); 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>