From 564eb08386cf20fe7cdd88c48f911176ce5bfc3d Mon Sep 17 00:00:00 2001 From: Lhcfl Date: Fri, 26 Apr 2024 22:39:58 +0800 Subject: [PATCH] feat: rewrite MkPagination for fold --- .../src/components/MkNotificationFolded.vue | 9 +- .../client/src/components/MkNotifications.vue | 18 +- .../client/src/components/MkPagination.vue | 459 +++++++++--------- packages/client/src/components/MkTimeline.vue | 2 +- packages/client/src/scripts/fold.ts | 57 +-- packages/client/src/scripts/scroll.ts | 3 + 6 files changed, 274 insertions(+), 274 deletions(-) diff --git a/packages/client/src/components/MkNotificationFolded.vue b/packages/client/src/components/MkNotificationFolded.vue index f3b9769e84..4f5048555c 100644 --- a/packages/client/src/components/MkNotificationFolded.vue +++ b/packages/client/src/components/MkNotificationFolded.vue @@ -26,7 +26,6 @@ : notification.reaction " :custom-emojis="notification.note.emojis" - :no-style="true" /> -import { onMounted, onUnmounted, ref } from "vue"; +import { computed, onMounted, onUnmounted, ref } from "vue"; import type { Connection } from "firefish-js/src/streaming"; import type { Channels } from "firefish-js/src/streaming.types"; import XReactionIcon from "@/components/MkReactionIcon.vue"; @@ -116,8 +115,10 @@ const defaultReaction = ["⭐", "👍", "❤️"].includes(instance.defaultReact ? instance.defaultReaction : "⭐"; -const users = ref(props.notification.users.slice(0, 5)); -const userleft = ref(props.notification.users.length - users.value.length); +const users = computed(() => props.notification.users.slice(0, 5)); +const userleft = computed( + () => props.notification.users.length - users.value.length, +); let readObserver: IntersectionObserver | undefined; let connection: Connection | null = null; diff --git a/packages/client/src/components/MkNotifications.vue b/packages/client/src/components/MkNotifications.vue index 919a064183..4d34707c17 100644 --- a/packages/client/src/components/MkNotifications.vue +++ b/packages/client/src/components/MkNotifications.vue @@ -1,5 +1,9 @@