mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-21 17:12:15 +00:00
protected sharing update
This commit is contained in:
8
resources/js/store/modules/fileBrowser.js
vendored
8
resources/js/store/modules/fileBrowser.js
vendored
@@ -77,8 +77,8 @@ const actions = {
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create shared object for history
|
||||
let trash = {
|
||||
@@ -114,8 +114,8 @@ const actions = {
|
||||
}
|
||||
|
||||
if (! back) context.commit('FLUSH_BROWSER_HISTORY')
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
context.commit('FLUSH_DATA')
|
||||
context.commit('LOADING_STATE', true)
|
||||
|
||||
// Create trash object for history
|
||||
let trash = {
|
||||
|
||||
19
resources/js/store/modules/fileFunctions.js
vendored
19
resources/js/store/modules/fileFunctions.js
vendored
@@ -29,10 +29,10 @@ const actions = {
|
||||
})
|
||||
.catch(() => isSomethingWrong())
|
||||
},
|
||||
changeItemName: ({commit, getters}, data) => {
|
||||
renameItem: ({commit, getters}, data) => {
|
||||
|
||||
// Updated name in favourites panel
|
||||
if (data.type === 'folder')
|
||||
if (getters.permission === 'master' && data.type === 'folder')
|
||||
commit('UPDATE_NAME_IN_FAVOURITES', data)
|
||||
|
||||
axios
|
||||
@@ -69,7 +69,8 @@ const actions = {
|
||||
.catch(error => {
|
||||
reject(error)
|
||||
|
||||
context.commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
|
||||
// Reset uploader
|
||||
commit('UPDATE_FILE_COUNT_PROGRESS', undefined)
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -100,10 +101,14 @@ const actions = {
|
||||
// Remove file
|
||||
commit('REMOVE_ITEM', data.unique_id)
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
else
|
||||
commit('REMOVE_ITEM_FROM_RECENT_UPLOAD', data.unique_id)
|
||||
// Remove item from sidebar
|
||||
if (getters.permission === 'master') {
|
||||
|
||||
if (data.type === 'folder')
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', data)
|
||||
else
|
||||
commit('REMOVE_ITEM_FROM_RECENT_UPLOAD', data.unique_id)
|
||||
}
|
||||
|
||||
// Remove file preview
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
12
resources/js/store/modules/sharing.js
vendored
12
resources/js/store/modules/sharing.js
vendored
@@ -37,15 +37,11 @@ const actions = {
|
||||
location: 'public'
|
||||
}
|
||||
|
||||
let route = getters.sharedDetail.protected ? '/api/browse-private/' : '/api/browse-public/'
|
||||
let route = getters.sharedDetail.protected ? '/api/browse-private/' : '/api/browse-public/' + router.currentRoute.params.token +'/'
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(route + currentFolder.unique_id, {
|
||||
params: {
|
||||
token: router.currentRoute.params.token
|
||||
}
|
||||
})
|
||||
.get(route + currentFolder.unique_id)
|
||||
.then(response => {
|
||||
|
||||
commit('LOADING_STATE', false)
|
||||
@@ -76,9 +72,9 @@ const actions = {
|
||||
},
|
||||
getSingleFile: ({commit, state}) => {
|
||||
|
||||
let route = state.sharedDetail.protected ? '/api/file-private/' : '/api/file-public/'
|
||||
let route = state.sharedDetail.protected ? '/api/file-private/' : '/api/file-public/' + router.currentRoute.params.token
|
||||
|
||||
axios.get(route + router.currentRoute.params.token)
|
||||
axios.get(route)
|
||||
.then(response => {
|
||||
commit('STORE_SHARED_FILE', response.data)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user