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

@ -1,3 +1,4 @@
import { useInterfaceStore } from '../../stores/interface.js'
import apiService from '../api/api.service.js'
import { promiseInterval } from '../promise_interval/promise_interval.js'
@ -70,7 +71,7 @@ const fetchNotifications = ({ store, args, older }) => {
return notifications
})
.catch((error) => {
store.dispatch('pushGlobalNotice', {
useInterfaceStore().pushGlobalNotice({
level: 'error',
messageKey: 'notifications.error',
messageArgs: [error.message],

View file

@ -2,6 +2,7 @@ import { camelCase } from 'lodash'
import apiService from '../api/api.service.js'
import { promiseInterval } from '../promise_interval/promise_interval.js'
import { useInterfaceStore } from '../../stores/interface.js'
const update = ({ store, statuses, timeline, showImmediately, userId, listId, pagination }) => {
const ccTimeline = camelCase(timeline)
@ -69,7 +70,7 @@ const fetchAndUpdate = ({
return { statuses, pagination }
})
.catch((error) => {
store.dispatch('pushGlobalNotice', {
useInterfaceStore().pushGlobalNotice({
level: 'error',
messageKey: 'timeline.error',
messageArgs: [error.message],