Skip to content

Commit bff81de

Browse files
committed
fix: Remove duplicate propfind call
This also was an XHR call which is not going through the end to end encryption proxy Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent a850a0b commit bff81de

File tree

2 files changed

+25
-35
lines changed

2 files changed

+25
-35
lines changed

apps/files/src/services/FileInfo.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

apps/files/src/views/Sidebar.vue

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
114114
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
115115
import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js'
116116
117-
import FileInfo from '../services/FileInfo.js'
118117
import LegacyView from '../components/LegacyView.vue'
119118
import SidebarTab from '../components/SidebarTab.vue'
120119
import SystemTags from '../../../systemtags/src/components/SystemTags.vue'
@@ -487,10 +486,31 @@ export default {
487486
this.loading = true
488487
489488
try {
490-
this.fileInfo = await FileInfo(this.davPath)
491-
// adding this as fallback because other apps expect it
492-
this.fileInfo.dir = this.file.split('/').slice(0, -1).join('/')
493-
this.node = await fetchNode({ path: (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/') })
489+
this.node = await fetchNode({ path: this.file })
490+
this.fileInfo = {
491+
id: this.node.fileid,
492+
path: this.node.dirname,
493+
name: this.node.basename,
494+
mtime: this.node.mtime.getTime(),
495+
etag: this.node.attributes.etag,
496+
size: this.node.size,
497+
hasPreview: this.node.attributes.hasPreview,
498+
isEncrypted: this.node.attributes.isEncrypted === 1,
499+
isFavourited: this.node.attributes.favorite === 1,
500+
mimetype: this.node.mime,
501+
permissions: this.node.permissions,
502+
mountType: this.node.attributes['mount-type'],
503+
sharePermissions: this.node.attributes['share-permissions'],
504+
shareAttributes: this.node.attributes['share-attributes'],
505+
type: this.node.type,
506+
// adding this as fallback because other apps expect it
507+
dir: this.file.split('/').slice(0, -1).join('/'),
508+
}
509+
510+
// TODO remove when no more legacy backbone is used
511+
this.fileInfo.get = (key) => this.fileInfo[key]
512+
this.fileInfo.isDirectory = () => this.fileInfo.mimetype === 'httpd/unix-directory'
513+
this.fileInfo.canEdit = () => Boolean(this.fileInfo.permissions & OC.PERMISSION_UPDATE)
494514
495515
// DEPRECATED legacy views
496516
// TODO: remove

0 commit comments

Comments
 (0)