diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2023-04-05 00:41:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-05 00:41:49 +0900 |
| commit | 7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c (patch) | |
| tree | 62ca232417372612f78761f26669b56a80d35733 /packages/frontend/src/components/MkNotification.vue | |
| parent | Merge branch 'develop' into fix/visibility-widening (diff) | |
| parent | enhance(backend): improve cache (diff) | |
| download | misskey-7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c.tar.gz misskey-7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c.tar.bz2 misskey-7bd0001e763a12c2b2aeb5cf4417f802cd4fbb4c.zip | |
Merge branch 'develop' into fix/visibility-widening
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 = () => { |