mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Merge branch 'develop' of https://codeberg.org/thatonecalculator/calckey into develop
This commit is contained in:
commit
8453d05115
@ -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({
|
||||
|
@ -13,8 +13,8 @@
|
||||
<MkButton primary class="start" @click="startUser"><i class="ph-plus-bold ph-lg"></i> {{
|
||||
i18n.ts.startMessaging
|
||||
}}</MkButton>
|
||||
<MkPagination v-slot="{ items }" :externalItemArray="messages" :pagination="dmsPagination">
|
||||
<MkChatPreview v-for="message in messages" :key="message.id" class="yweeujhr message _block"
|
||||
<MkPagination v-slot="{ items }" :pagination="dmsPagination">
|
||||
<MkChatPreview v-for="message in items" :key="message.id" class="yweeujhr message _block"
|
||||
:message="message" />
|
||||
</MkPagination>
|
||||
</div>
|
||||
@ -28,8 +28,8 @@
|
||||
i18n.ts.startMessaging
|
||||
}}</MkButton>
|
||||
</div>
|
||||
<MkPagination v-slot="{ items }" :externalItemArray="groupMessages" :pagination="groupsPagination">
|
||||
<MkChatPreview v-for="message in groupMessages" :key="message.id" class="yweeujhr message _block"
|
||||
<MkPagination v-slot="{ items }" :pagination="groupsPagination">
|
||||
<MkChatPreview v-for="message in items" :key="message.id" class="yweeujhr message _block"
|
||||
:message="message" />
|
||||
</MkPagination>
|
||||
</div>
|
||||
@ -62,8 +62,9 @@ import 'swiper/scss/virtual';
|
||||
const router = useRouter();
|
||||
|
||||
let messages = $ref([]);
|
||||
let groupMessages = $ref([]);
|
||||
let connection = $ref(null);
|
||||
let paginationComponentUser = $ref<InstanceType<typeof MkPagination>>();
|
||||
let paginationComponentGroup = $ref<InstanceType<typeof MkPagination>>();
|
||||
|
||||
const tabs = ['dms', 'groups'];
|
||||
let tab = $ref(tabs[0]);
|
||||
@ -116,9 +117,10 @@ function onMessage(message): void {
|
||||
|
||||
messages.unshift(message);
|
||||
} else if (message.groupId) {
|
||||
groupMessages = groupMessages.filter(m => m.groupId !== message.groupId);
|
||||
groupMessages.unshift(message);
|
||||
messages = messages.filter(m => m.groupId !== message.groupId);
|
||||
messages.unshift(message);
|
||||
}
|
||||
forceRerender();
|
||||
}
|
||||
|
||||
function onRead(ids): void {
|
||||
|
Loading…
Reference in New Issue
Block a user