Refactoring

This commit is contained in:
syuilo
2020-11-03 15:59:13 +09:00
parent ab166959a4
commit e2a9a0ff3d
4 changed files with 23 additions and 66 deletions

View File

@@ -42,7 +42,6 @@ export default defineComponent({
host: host,
pageKey: 0,
pageInfo: null,
connection: null,
faLayerGroup, faBars, faBell, faHome, faCircle,
};
},
@@ -70,9 +69,6 @@ export default defineComponent({
created() {
document.documentElement.style.overflowY = 'scroll';
this.connection = os.stream.useSharedConnection('main', 'UI');
this.connection.on('notification', this.onNotification);
},
methods: {
@@ -94,23 +90,6 @@ export default defineComponent({
onTransition() {
if (window._scroll) window._scroll();
},
onNotification(notification) {
if (this.$store.state.i.mutingNotificationTypes.includes(notification.type)) {
return;
}
if (document.visibilityState === 'visible') {
os.stream.send('readNotification', {
id: notification.id
});
os.popup(import('@/components/toast.vue'), {
notification
}, {}, 'closed');
}
os.sound('notification');
},
}
});
</script>