aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-04-17 00:15:46 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-04-17 20:09:14 +0200
commit6c9ca8b0253c67c499cf233235a2aad8b72f48ce (patch)
tree2b206374f7f40a3aa85544efd51c8eaa4d2ed64f /apps/files/src
parentb4004a258296bbe8563a5c76f8e611976c2a7ffd (diff)
downloadnextcloud-server-6c9ca8b0253c67c499cf233235a2aad8b72f48ce.tar.gz
nextcloud-server-6c9ca8b0253c67c499cf233235a2aad8b72f48ce.zip
fix(comments): Fix issues thrown by comments sidebar tab code
When the comments tab is used instead of the merged activity+comments, then some issues are throws due to prop altering and duplicated names (resourceId as prop and data). This is fixed as well as some other vue related errors in the sidebar Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/views/Sidebar.vue8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue
index c2aed34d046..398144e2414 100644
--- a/apps/files/src/views/Sidebar.vue
+++ b/apps/files/src/views/Sidebar.vue
@@ -33,7 +33,7 @@
@opened="handleOpened"
@closing="handleClosing"
@closed="handleClosed">
- <template #subname>
+ <template v-if="fileInfo" #subname>
<NcIconSvgWrapper v-if="fileInfo.isFavourited"
:path="mdiStar"
:name="t('files', 'Favorite')"
@@ -222,7 +222,7 @@ export default {
* @return {string}
*/
size() {
- return formatFileSize(this.fileInfo.size)
+ return formatFileSize(this.fileInfo?.size)
},
/**
@@ -334,7 +334,7 @@ export default {
},
getPreviewIfAny(fileInfo) {
- if (fileInfo.hasPreview && !this.isFullScreen) {
+ if (fileInfo?.hasPreview && !this.isFullScreen) {
return generateUrl(`/core/preview?fileId=${fileInfo.id}&x=${screen.width}&y=${screen.height}&a=true`)
}
return this.getIconUrl(fileInfo)
@@ -348,7 +348,7 @@ export default {
* @return {string} Url to the icon for mimeType
*/
getIconUrl(fileInfo) {
- const mimeType = fileInfo.mimetype || 'application/octet-stream'
+ const mimeType = fileInfo?.mimetype || 'application/octet-stream'
if (mimeType === 'httpd/unix-directory') {
// use default folder icon
if (fileInfo.mountType === 'shared' || fileInfo.mountType === 'shared-root') {