Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
65 changes: 24 additions & 41 deletions apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -450,23 +450,8 @@ export default {
)

for (const share of shares) {
if ([ShareType.Link, ShareType.Email].includes(share.type)) {
this.linkShares.push(share)
} else if ([ShareType.Remote, ShareType.RemoteGroup].includes(share.type)) {
if (this.config.showFederatedSharesToTrustedServersAsInternal) {
if (share.isTrustedServer) {
this.shares.push(share)
} else {
this.externalShares.push(share)
}
} else if (this.config.showFederatedSharesAsInternal) {
this.shares.push(share)
} else {
this.externalShares.push(share)
}
} else {
this.shares.push(share)
}
const shareList = this.findShareListByShare(share)
shareList.push(share)
}

logger.debug(`Processed ${this.linkShares.length} link share(s)`)
Expand Down Expand Up @@ -529,24 +514,8 @@ export default {
* @param {Function} [resolve] a function to run after the share is added and its component initialized
*/
addShare(share, resolve = () => { }) {
// only catching share type MAIL as link shares are added differently
// meaning: not from the ShareInput
if (share.type === ShareType.Email) {
this.linkShares.unshift(share)
} else if ([ShareType.Remote, ShareType.RemoteGroup].includes(share.type)) {
if (this.config.showFederatedSharesAsInternal) {
this.shares.unshift(share)
}
if (this.config.showFederatedSharesToTrustedServersAsInternal) {
if (share.isTrustedServer) {
this.shares.unshift(share)
}
} else {
this.externalShares.unshift(share)
}
} else {
this.shares.unshift(share)
}
const shareList = this.findShareListByShare(share)
shareList.unshift(share)
this.awaitForShare(share, resolve)
},

Expand All @@ -556,12 +525,26 @@ export default {
* @param {Share} share the share to remove
*/
removeShare(share) {
// Get reference for this.linkShares or this.shares
const shareList
= share.type === ShareType.Email
|| share.type === ShareType.Link
? this.linkShares
: this.shares
this.removeShareFromList(this.findShareListByShare(share), share)
},

findShareListByShare(share) {
if (share.type === ShareType.Remote || share.type === ShareType.RemoteGroup) {
if (this.config.showFederatedSharesToTrustedServersAsInternal) {
return share.isTrustedServer ? this.shares : this.externalShares
} else if (this.config.showFederatedSharesAsInternal) {
return this.shares
} else {
return this.externalShares
}
} else if (share.type === ShareType.Email || share.type === ShareType.Link) {
return this.linkShares
} else {
return this.shares
}
},

removeShareFromList(shareList, share) {
const index = shareList.findIndex((item) => item.id === share.id)
if (index !== -1) {
shareList.splice(index, 1)
Expand Down
6 changes: 3 additions & 3 deletions dist/1035-1035.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.3
- license: GPL-3.0-or-later
- @nextcloud/files
- version: 4.0.0-rc.1
- version: 4.0.0-rc.0
- license: AGPL-3.0-or-later
- @nextcloud/initial-state
- version: 3.0.0
Expand All @@ -77,7 +77,7 @@ This file is generated from multiple sources. Included packages:
- version: 0.3.0
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.36.0
- version: 8.35.3
- license: AGPL-3.0-or-later
- @vue/devtools-api
- version: 6.6.4
Expand Down Expand Up @@ -161,7 +161,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.7.16
- license: MIT
- webdav
- version: 5.9.0
- version: 5.8.0
- license: MIT
- base64-js
- version: 1.5.1
Expand Down
2 changes: 1 addition & 1 deletion dist/1035-1035.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/1216-1216.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.1.0
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.36.0
- version: 8.35.3
- license: AGPL-3.0-or-later
- @vueuse/core
- version: 11.3.0
Expand Down
2 changes: 1 addition & 1 deletion dist/1216-1216.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/1404-1404.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.1.0
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.36.0
- version: 8.35.3
- license: AGPL-3.0-or-later
- @vueuse/components
- version: 11.3.0
Expand Down Expand Up @@ -131,7 +131,7 @@ This file is generated from multiple sources. Included packages:
- version: 6.0.1
- license: MIT
- unist-util-visit
- version: 5.1.0
- version: 5.0.0
- license: MIT
- vue-demi
- version: 0.14.10
Expand Down
Loading
Loading