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 @@ -497,7 +497,10 @@ export default defineComponent({
497497 // canDrop already gates this branch on FileType.Folder, but the
498498 // type system can't see that — narrow defensively so a future
499499 // loosening of canDrop can't silently lie via the cast below.
500- if ( ! ( this . source instanceof Folder ) ) {
500+ // Use the `type` field rather than `instanceof Folder`: apps
501+ // bundle their own copy of @nextcloud /files, so a Folder from
502+ // an app would not be `instanceof` the server's Folder class.
503+ if ( this . source . type !== FileType . Folder ) {
501504 logger . error ( 'onDrop: external drop target is not a Folder' , { source : this . source } )
502505 this . dragover = false
503506 return
@@ -510,7 +513,7 @@ export default defineComponent({
510513 : cachedContents
511514
512515 logger . debug ( 'Start uploading dropped files' , { target : this . source . path , fileTree } )
513- await onDropExternalFiles ( fileTree , this . source , contents )
516+ await onDropExternalFiles ( fileTree , this . source as Folder , contents )
514517 this . dragover = false
515518 return
516519 }
You can’t perform that action at this time.
0 commit comments