diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-06-06 18:48:02 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-06-12 10:27:29 +0200 |
commit | a0a36563b61c85989a0791edfac1ed07bf920787 (patch) | |
tree | fd5b2a47ac2e32e0203edccb1b4f56754c3237c7 /apps/files/src | |
parent | f626476b11c25ab002e95d2c8ae54fc802bdf185 (diff) | |
download | nextcloud-server-a0a36563b61c85989a0791edfac1ed07bf920787.tar.gz nextcloud-server-a0a36563b61c85989a0791edfac1ed07bf920787.zip |
fix(files_sharing): fix parsing of remote shares
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src')
-rw-r--r-- | apps/files/src/actions/moveOrCopyActionUtils.ts | 5 | ||||
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/apps/files/src/actions/moveOrCopyActionUtils.ts b/apps/files/src/actions/moveOrCopyActionUtils.ts index 80c97fcc147..511fd32d134 100644 --- a/apps/files/src/actions/moveOrCopyActionUtils.ts +++ b/apps/files/src/actions/moveOrCopyActionUtils.ts @@ -51,7 +51,8 @@ export const canDownload = (nodes: Node[]) => { } export const canCopy = (nodes: Node[]) => { - // For now the only restriction is that a shared file - // cannot be copied if the download is disabled + // a shared file cannot be copied if the download is disabled + // it can be copied if the user has at least read permissions return canDownload(nodes) + && !nodes.some(node => node.permissions === Permission.NONE) } diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 103b6046f26..cfce3e924e8 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -65,7 +65,7 @@ class="files-list__row-mtime" data-cy-files-list-row-mtime @click="openDetailsIfAvailable"> - <NcDateTime :timestamp="source.mtime" :ignore-seconds="true" /> + <NcDateTime v-if="source.mtime" :timestamp="source.mtime" :ignore-seconds="true" /> </td> <!-- View columns --> @@ -177,8 +177,8 @@ export default defineComponent({ }, size() { - const size = parseInt(this.source.size, 10) || 0 - if (typeof size !== 'number' || size < 0) { + const size = parseInt(this.source.size, 10) + if (typeof size !== 'number' || isNaN(size) || size < 0) { return this.t('files', 'Pending') } return formatFileSize(size, true) @@ -186,8 +186,8 @@ export default defineComponent({ sizeOpacity() { const maxOpacitySize = 10 * 1024 * 1024 - const size = parseInt(this.source.size, 10) || 0 - if (!size || size < 0) { + const size = parseInt(this.source.size, 10) + if (!size || isNaN(size) || size < 0) { return {} } |