parent
a7ee4aabcb
commit
23f106a0c1
26 changed files with 628 additions and 573 deletions
|
@ -22,7 +22,7 @@ import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
|||
import XNotification from '@/components/MkNotification.vue';
|
||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
||||
import MkNote from '@/components/MkNote.vue';
|
||||
import { stream } from '@/stream';
|
||||
import { useStream } from '@/stream';
|
||||
import { $i } from '@/account';
|
||||
import { i18n } from '@/i18n';
|
||||
import { notificationTypes } from '@/const';
|
||||
|
@ -45,7 +45,7 @@ const pagination: Paging = {
|
|||
const onNotification = (notification) => {
|
||||
const isMuted = props.includeTypes ? !props.includeTypes.includes(notification.type) : $i.mutingNotificationTypes.includes(notification.type);
|
||||
if (isMuted || document.visibilityState === 'visible') {
|
||||
stream.send('readNotification');
|
||||
useStream().send('readNotification');
|
||||
}
|
||||
|
||||
if (!isMuted) {
|
||||
|
@ -56,7 +56,7 @@ const onNotification = (notification) => {
|
|||
let connection;
|
||||
|
||||
onMounted(() => {
|
||||
connection = stream.useChannel('main');
|
||||
connection = useStream().useChannel('main');
|
||||
connection.on('notification', onNotification);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue