Skip to content

Commit d354308

Browse files
committed
Fix version store to only update when value changes
1 parent 6894011 commit d354308

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/lib/stores/versionStore.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ const createVersionStore = () => {
3737
},
3838

3939
/**
40-
* Set the version for a specific package
40+
* Set the version for a specific package (only updates if changed)
4141
*/
4242
setVersion(packageId: PackageId, tag: string) {
4343
update((versions) => {
44+
// Skip update if version is already the same
45+
if (versions[packageId] === tag) {
46+
return versions;
47+
}
4448
const updated = { ...versions, [packageId]: tag };
4549
this.persist(updated);
4650
return updated;

0 commit comments

Comments
 (0)