fix: Properly take show_hidden user setting into account for file listing

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2023-12-04 12:35:43 +01:00
parent 52aadb5fd2
commit 6a938e1ae9
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -281,10 +281,16 @@ export default defineComponent({
},
dirContents(): Node[] {
const showHidden = this.userConfigStore?.userConfig.show_hidden
return (this.currentFolder?._children || [])
.map(this.getNode)
.filter(file => file)
.filter(file => file?.attributes?.hidden !== true)
.filter(file => {
if (!showHidden) {
return file?.attributes?.hidden !== true && !file?.basename.startsWith('.')
}
return true
})
},
/**