[web] Fix a bug preventing the files page to not load when refreshing page

This commit is contained in:
Alain Nussbaumer 2024-04-09 18:51:21 +02:00
parent 60f14adb47
commit ff9537514a
1 changed files with 9 additions and 1 deletions

View File

@ -60,7 +60,15 @@ const dataObject = {
vm.playlists = new GroupedList(response.data.playlists)
vm.tracks = new GroupedList(response.data.tracks)
} else {
vm.dirs = vm.$store.state.config.directories.map((dir) => ({ path: dir }))
if (vm.$store.state.config.directories) {
vm.dirs = vm.$store.state.config.directories.map((dir) => ({
path: dir
}))
} else {
webapi.config().then((config) => {
vm.dirs = config.data.directories.map((dir) => ({ path: dir }))
})
}
vm.playlists = new GroupedList()
vm.tracks = new GroupedList()
}