aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2025-02-21 10:18:47 +0100
committerskjnldsv <skjnldsv@protonmail.com>2025-02-21 10:49:43 +0100
commit4a96441437f7855cbce0bda617250ccd175fa430 (patch)
tree77a9c4fd8f36a75e8b703d3f13cb2913b0ddd93b /apps/files/src
parentbc1943da4b2060a808dff718e49e3cb8d84b09cf (diff)
downloadnextcloud-server-4a96441437f7855cbce0bda617250ccd175fa430.tar.gz
nextcloud-server-4a96441437f7855cbce0bda617250ccd175fa430.zip
fix(files): handle failed node properly
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/components/FileEntryMixin.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts
index d949a907d43..ece4f4ce225 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -133,11 +133,16 @@ export default defineComponent({
return this.source.status === NodeStatus.FAILED
},
- canDrag() {
+ canDrag(): boolean {
if (this.isRenaming) {
return false
}
+ // Ignore if the node is not available
+ if (this.isFailedSource) {
+ return false
+ }
+
const canDrag = (node: Node): boolean => {
return (node?.permissions & Permission.UPDATE) !== 0
}
@@ -150,11 +155,16 @@ export default defineComponent({
return canDrag(this.source)
},
- canDrop() {
+ canDrop(): boolean {
if (this.source.type !== FileType.Folder) {
return false
}
+ // Ignore if the node is not available
+ if (this.isFailedSource) {
+ return false
+ }
+
// If the current folder is also being dragged, we can't drop it on itself
if (this.draggingFiles.includes(this.source.source)) {
return false
@@ -274,6 +284,11 @@ export default defineComponent({
return
}
+ // Ignore right click if the node is not available
+ if (this.isFailedSource) {
+ return
+ }
+
// The grid mode is compact enough to not care about
// the actions menu mouse position
if (!this.gridMode) {
@@ -311,6 +326,11 @@ export default defineComponent({
return
}
+ // Ignore if the node is not available
+ if (this.isFailedSource) {
+ return
+ }
+
// if ctrl+click / cmd+click (MacOS uses the meta key) or middle mouse button (button & 4), open in new tab
// also if there is no default action use this as a fallback
const metaKeyPressed = event.ctrlKey || event.metaKey || Boolean(event.button & 4)