Skip to content

Commit

Permalink
! Fix default playlists added when no playlist stored had no required…
Browse files Browse the repository at this point in the history
… attributes added on 1st run
  • Loading branch information
PikachuEXE committed Aug 15, 2023
1 parent 38c0ca2 commit bcc99a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/renderer/store/modules/playlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ const actions = {
try {
const payload = (await DBPlaylistHandlers.find()).filter((e) => e != null)
if (payload.length === 0) {
dispatch('addPlaylists', state.defaultPlaylists)
// Not using `addPlaylists` to ensure required attributes with dynamic values added
state.defaultPlaylists.forEach(playlist => {
dispatch('addPlaylist', playlist)
})
} else {
payload.forEach((playlist) => {
let anythingUpdated = false
Expand Down

0 comments on commit bcc99a1

Please sign in to comment.