diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-04 14:06:57 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-04 14:06:57 +0900 |
| commit | 30d699268450af375dabc2226ec4f3196a53f7f7 (patch) | |
| tree | e6e62a4b19f190d2a51e4a5281c051b6911f97a1 /packages/frontend/src/components/MkNotification.vue | |
| parent | build(#10336): Storybook & Chromatic & msw (#10365) (diff) | |
| download | misskey-30d699268450af375dabc2226ec4f3196a53f7f7.tar.gz misskey-30d699268450af375dabc2226ec4f3196a53f7f7.tar.bz2 misskey-30d699268450af375dabc2226ec4f3196a53f7f7.zip | |
perf(backend): 通知をRedisに保存するように
Resolve #10168
Diffstat (limited to 'packages/frontend/src/components/MkNotification.vue')
| -rw-r--r-- | packages/frontend/src/components/MkNotification.vue | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue index b60967de02..efae687e66 100644 --- a/packages/frontend/src/components/MkNotification.vue +++ b/packages/frontend/src/components/MkNotification.vue @@ -83,7 +83,7 @@ </template> <script lang="ts" setup> -import { ref, shallowRef, onMounted, onUnmounted, watch } from 'vue'; +import { ref, shallowRef } from 'vue'; import * as misskey from 'misskey-js'; import MkReactionIcon from '@/components/MkReactionIcon.vue'; import MkFollowButton from '@/components/MkFollowButton.vue'; @@ -94,7 +94,6 @@ import { notePage } from '@/filters/note'; import { userPage } from '@/filters/user'; import { i18n } from '@/i18n'; import * as os from '@/os'; -import { stream } from '@/stream'; import { useTooltip } from '@/scripts/use-tooltip'; import { $i } from '@/account'; @@ -110,35 +109,6 @@ const props = withDefaults(defineProps<{ const elRef = shallowRef<HTMLElement>(null); const reactionRef = ref(null); -let readObserver: IntersectionObserver | undefined; -let connection; - -onMounted(() => { - if (!props.notification.isRead) { - readObserver = new IntersectionObserver((entries, observer) => { - if (!entries.some(entry => entry.isIntersecting)) return; - stream.send('readNotification', { - id: props.notification.id, - }); - observer.disconnect(); - }); - - readObserver.observe(elRef.value); - - connection = stream.useChannel('main'); - connection.on('readAllNotifications', () => readObserver.disconnect()); - - watch(props.notification.isRead, () => { - readObserver.disconnect(); - }); - } -}); - -onUnmounted(() => { - if (readObserver) readObserver.disconnect(); - if (connection) connection.dispose(); -}); - const followRequestDone = ref(false); const acceptFollowRequest = () => { |