Skip to content

Commit

Permalink
fix: fix local garden store update when index === 0
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rgall committed Sep 3, 2024
1 parent a17e015 commit 5004b83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/stores/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const addToAllGardens = async (garden: Garden) => {
// Update the the specific garden in the local store of gardens
allGardens.update((gardens) => {
const index = gardens.findIndex((g) => g.id === garden.id);
if (index) {
if (typeof index === 'number') {
gardens[index] = garden;
} else {
gardens.push(garden);
Expand Down

0 comments on commit 5004b83

Please sign in to comment.