Skip to content

Commit

Permalink
Merge pull request #118 from BaptisteLongy/test-fixing-undefined-gold…
Browse files Browse the repository at this point in the history
…PlannerConfiguration

Possible fix for goldPlannerConfiguration undefined issue
  • Loading branch information
fayaine authored Jul 12, 2024
2 parents 31aa9fb + c0dae5a commit 2ed218d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/client/src/app/core/database/services/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ export class SettingsService extends FirestoreStorage<Settings> {
})
);
}

// Smooth migration
if (settings.goldPlannerConfiguration === undefined) {
settings.goldPlannerConfiguration = {}
return this.setOne(uid, settings).pipe(
mapTo({
...settings,
$key: uid
})
);
}

return of(settings);
})
);
Expand Down

0 comments on commit 2ed218d

Please sign in to comment.