mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
after cancelled shared link in SharedLinks, remove items from view
This commit is contained in:
19
resources/js/store/modules/sharing.js
vendored
19
resources/js/store/modules/sharing.js
vendored
@@ -69,16 +69,8 @@ const actions = {
|
||||
},
|
||||
shareCancel: ({ commit, getters }, singleItem) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let tokens = []
|
||||
let items = [singleItem]
|
||||
|
||||
if (!singleItem) {
|
||||
items = getters.clipboard
|
||||
}
|
||||
|
||||
items.forEach((item) => {
|
||||
tokens.push(item.data.relationships.shared.data.attributes.token)
|
||||
})
|
||||
let items = singleItem ? [singleItem] : getters.clipboard
|
||||
let tokens = items.map((item) => item.data.relationships.shared.data.attributes.token)
|
||||
|
||||
axios
|
||||
.post('/api/share/revoke', {
|
||||
@@ -88,16 +80,13 @@ const actions = {
|
||||
.then(() => {
|
||||
items.forEach((item) => {
|
||||
// Remove item from file browser
|
||||
if (
|
||||
getters.currentFolder &&
|
||||
Vue.prototype.$isThisRoute(router.currentRoute, ['MySharedItems'])
|
||||
) {
|
||||
if (Vue.prototype.$isThisRoute(router.currentRoute, ['MySharedItems'])) {
|
||||
commit('REMOVE_ITEM', item.data.id)
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
}
|
||||
|
||||
// Flush shared data
|
||||
commit('FLUSH_SHARED', item.data.id)
|
||||
commit('CLIPBOARD_CLEAR')
|
||||
})
|
||||
resolve(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user