♻️ (notif) add queue notif service to lazy load notif lib
This commit is contained in:
12
src/store.ts
12
src/store.ts
@@ -7,9 +7,9 @@ import couchService from '@/services/CouchService'
|
||||
import IResponse from '@/models/IResponse'
|
||||
import IUserPassword from '@/models/IUserPassword'
|
||||
import IIdPassword from '@/models/IEmailPassword'
|
||||
import notif from '@/utils/notif'
|
||||
import { hasGoodNetwork } from '@/utils/network'
|
||||
import { toHex } from './utils'
|
||||
import { toHex } from '@/utils'
|
||||
import queueNotifService from '@/services/QueueNotifService'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
@@ -108,7 +108,7 @@ export default new Vuex.Store<IState>({
|
||||
if (response.ok) {
|
||||
commit(SET_USER, { user, replicate })
|
||||
} else {
|
||||
notif.error(response.message || '')
|
||||
queueNotifService.error(response.message || '')
|
||||
}
|
||||
},
|
||||
async login({ commit, state }, { userId, password }: IIdPassword) {
|
||||
@@ -117,7 +117,7 @@ export default new Vuex.Store<IState>({
|
||||
const user: IUser | null = await userService.getUser(state.user)
|
||||
commit(SET_USER, { user })
|
||||
} else {
|
||||
notif.error(response.message || '')
|
||||
queueNotifService.error(response.message || '')
|
||||
}
|
||||
},
|
||||
async logout({ commit }) {
|
||||
@@ -125,7 +125,7 @@ export default new Vuex.Store<IState>({
|
||||
if (response.ok) {
|
||||
commit(SET_USER, { user: null })
|
||||
} else {
|
||||
notif.error(response.message || '')
|
||||
queueNotifService.error(response.message || '')
|
||||
}
|
||||
},
|
||||
async remove({ commit, state }) {
|
||||
@@ -134,7 +134,7 @@ export default new Vuex.Store<IState>({
|
||||
if (response.ok) {
|
||||
commit(SET_USER, { user: null })
|
||||
} else {
|
||||
notif.error(response.message || '')
|
||||
queueNotifService.error(response.message || '')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user