Fix share owner not being displayed in sharing tab

This only concerns subfolder and files inside a shared folder and is
used as fallback when the OCS api returns a empty result, because it
only works on the shared folder and not the content inside of it.
This unify the tab with the folder list.

This offers a less descriptive share information but making the
OCS api returns all the details even for the subfolder would very
probably be bad for performance (since we would need to fetch the shares
for all the parent folders until we found one or are in the root folder).

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
pull/30314/head
Carl Schwan 2021-12-14 13:30:14 +07:00
parent d750eb1da8
commit c886f5e9ea
No known key found for this signature in database
GPG Key ID: 06B35D38387B67BE
3 changed files with 15 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -291,6 +291,19 @@ export default {
// interval update
this.expirationInterval = setInterval(this.updateExpirationSubtitle, 10000, share)
}
} else if (this.fileInfo && this.fileInfo.shareOwnerId !== undefined ? this.fileInfo.shareOwnerId !== OC.currentUser : false) {
// Fallback to compare owner and current user.
this.sharedWithMe = {
displayName: this.fileInfo.shareOwner,
title: t(
'files_sharing',
'Shared with you by {owner}',
{ owner: this.fileInfo.shareOwner },
undefined,
{ escape: false }
),
user: this.fileInfo.shareOwnerId,
}
}
},