@samitouri / QOSami-HFS / commits / 2c20d9a1

fix: renaming of a folder made it display as a file #929

Massimo Melina committed Mar 5, 2025 at 23:49 UTC 2c20d9a14b0e2025dcfcabd7a401b4ccc05a6041
1 file changed +1 -1
frontend/src/state.ts
+1 -1
@@ -113,10 +113,10 @@ export class DirEntry implements ServerDirEntry {
113 public readonly key?: string
114
115 constructor(n: string, rest?: any) {
116 - Object.assign(this, rest) // we actually allow any custom property to be memorized
116 this.isFolder = n.endsWith('/')
117 if (this.isFolder)
118 n = n.slice(0, -1)
119 + Object.assign(this, rest) // we actually allow any custom property to be memorized
120 this.n = n // must do it after 'rest' to avoid overwriting
121 this.uri = rest?.url || ((n[0] === '/' ? '' : location.pathname) + pathEncode(n) + (this.isFolder ? '/' : ''))
122 if (!this.isFolder) {