File tree Expand file tree Collapse file tree
apps/files/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,7 +480,10 @@ export default defineComponent({
480480 // canDrop already gates this branch on FileType.Folder, but the
481481 // type system can't see that — narrow defensively so a future
482482 // loosening of canDrop can't silently lie via the cast below.
483- if ( ! ( this . source instanceof Folder ) ) {
483+ // Use the `type` field rather than `instanceof Folder`: apps
484+ // bundle their own copy of @nextcloud /files, so a Folder from
485+ // an app would not be `instanceof` the server's Folder class.
486+ if ( this . source . type !== FileType . Folder ) {
484487 logger . error ( 'onDrop: external drop target is not a Folder' , { source : this . source } )
485488 this . dragover = false
486489 return
@@ -493,7 +496,7 @@ export default defineComponent({
493496 : cachedContents
494497
495498 logger . debug ( 'Start uploading dropped files' , { target : this . source . path , fileTree } )
496- await onDropExternalFiles ( fileTree , this . source , contents )
499+ await onDropExternalFiles ( fileTree , this . source as Folder , contents )
497500 this . dragover = false
498501 return
499502 }
You can’t perform that action at this time.
0 commit comments