♻️ (notif) add queue notif service to lazy load notif lib

This commit is contained in:
Julien Calixte
2020-04-11 00:53:27 +02:00
parent 8a76042625
commit b79569102d
19 changed files with 1280 additions and 1012 deletions

View File

@@ -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 || '')
}
}
},