Skip to content

Commit

Permalink
Merge resource info with existing record in store
Browse files Browse the repository at this point in the history
Dropped the merging recently in 72b8805, but it's needed for instance
when a resourceInfoAll response comes after downloadConfig responses.
  • Loading branch information
arildm committed Mar 18, 2024
1 parent 422f472 commit 1419c9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/store/resource.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export const useResourceStore = defineStore("resource", () => {
resource.publicId = info.resource.public_id;
}

resources[info.resource.id] = resource;
// Merge with any existing record.
resources[info.resource.id] = {
...(resources[info.resource.id] || {}),
resource,
};
return resource;
}

Expand Down

0 comments on commit 1419c9f

Please sign in to comment.