vuefilemanager v1.5-alpha.1

This commit is contained in:
carodej
2020-04-29 11:32:08 +02:00
parent 2614efe601
commit 0f3cbaec3d
50 changed files with 426 additions and 355 deletions
+20 -10
View File
@@ -43,7 +43,9 @@ const actions = {
location: folder.deleted_at || folder.location === 'trash' ? 'trash' : 'base'
}
let url = currentFolder.location === 'trash' ? '/folders/' + currentFolder.unique_id + '?trash=true' : '/folders/' + currentFolder.unique_id
let url = currentFolder.location === 'trash'
? '/folders/' + currentFolder.unique_id + '?trash=true'
: '/folders/' + currentFolder.unique_id
axios
.get(context.getters.api + url)
@@ -61,12 +63,22 @@ const actions = {
if (!init) context.commit('ADD_BROWSER_HISTORY', currentFolder)
}
})
.catch(() => {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
.catch(error => {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
context.commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
})
},
getShared: (context, back = false) => {
@@ -187,7 +199,7 @@ const actions = {
if (getters.sharedDetail && getters.sharedDetail.protected)
route = '/api/navigation/private'
else if (getters.sharedDetail && ! getters.sharedDetail.protected)
else if (getters.sharedDetail && !getters.sharedDetail.protected)
route = '/api/navigation/public/' + router.currentRoute.params.token
else
route = '/api/navigation'
@@ -209,8 +221,6 @@ const actions = {
})
})
})
},
}