Skip to content

Commit

Permalink
fix: set mergedefaults on our localstore-usage
Browse files Browse the repository at this point in the history
the store was not properly updated for old entries (not having the
updated-field) when only the updated-field was updated
  • Loading branch information
mangadoot committed Jan 22, 2023
1 parent adc891f commit 1f37e90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Stores/NotesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const defaultEntry: AnimePlanetEntry = {
slug: '',
links: [],
note: '',
updated: undefined,
};

export const useNotesStore = defineStore('anime-planet-store', {
Expand All @@ -24,6 +25,7 @@ export const useNotesStore = defineStore('anime-planet-store', {
`apn:${siteInfo.type}:${siteInfo.id}`,
{ ...defaultEntry, slug: siteInfo.slug },
{
mergeDefaults: true,
writeDefaults: false,
},
) as unknown as AnimePlanetEntry,
Expand Down

0 comments on commit 1f37e90

Please sign in to comment.