Skip to content

Commit

Permalink
[web] Fix a bug preventing the files page to not load when refreshing…
Browse files Browse the repository at this point in the history
… page
  • Loading branch information
hacketiwack committed Apr 9, 2024
1 parent 60f14ad commit ff95375
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion web-src/src/pages/PageFiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit ff95375

Please sign in to comment.