Replace depricated addRoutes with addRoute

This commit is contained in:
Angelina Filippova 2021-02-08 00:13:41 +03:00
parent 2d27962e16
commit 8c9b5d5972

View file

@ -28,7 +28,7 @@ export const beforeEachRoute = (to, from, next) => {
store.dispatch('GetUserInfo').then(res => {
const roles = res.data.pleroma.is_admin ? ['admin'] : []
store.dispatch('GenerateRoutes', { roles }).then(() => {
router.addRoutes(store.getters.addRouters)
store.getters.addRouters.forEach(route => router.addRoute(route))
next({ ...to, replace: true })
})
}).catch((err) => {