Migrate interface module to store

This commit is contained in:
Sean King 2023-04-05 21:06:37 -06:00
commit b1dcea0199
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
33 changed files with 244 additions and 77 deletions

View file

@ -11,6 +11,7 @@ import {
import FaviconService from '../../services/favicon_service/favicon_service.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleNotch, faArrowUp, faMinus } from '@fortawesome/free-solid-svg-icons'
import { useInterfaceStore } from '../../stores/interface'
library.add(
faCircleNotch,
@ -75,11 +76,11 @@ const Notifications = {
return this.$store.state.statuses.notifications.loading
},
noHeading () {
const { layoutType } = this.$store.state.interface
const { layoutType } = useInterfaceStore()
return this.minimalMode || layoutType === 'mobile'
},
teleportTarget () {
const { layoutType } = this.$store.state.interface
const { layoutType } = useInterfaceStore()
const map = {
wide: '#notifs-column',
mobile: '#mobile-notifications'
@ -87,7 +88,7 @@ const Notifications = {
return map[layoutType] || '#notifs-sidebar'
},
popoversZLayer () {
const { layoutType } = this.$store.state.interface
const { layoutType } = useInterfaceStore()
return layoutType === 'mobile' ? 'navbar' : null
},
notificationsToDisplay () {
@ -114,10 +115,10 @@ const Notifications = {
unseenCountTitle (count) {
if (count > 0) {
FaviconService.drawFaviconBadge()
this.$store.dispatch('setPageTitle', `(${count})`)
useInterfaceStore().setPageTitle(`(${count})`)
} else {
FaviconService.clearFaviconBadge()
this.$store.dispatch('setPageTitle', '')
useInterfaceStore().setPageTitle('')
}
},
teleportTarget () {