refactor(frontend): boot分割したり副作用減らしたりとか

#10838
This commit is contained in:
syuilo 2023-05-15 19:08:46 +09:00
parent a7ee4aabcb
commit 23f106a0c1
26 changed files with 628 additions and 573 deletions

View file

@ -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);
});