Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Code refinements

Luke Vella1284b0ac0461
diff --git a/apps/web/src/app/[locale]/(space)/account/preferences/components/date-time-preferences.tsx b/apps/web/src/app/[locale]/(space)/account/preferences/components/date-time-preferences.tsx
index 0eafef9d4..956e89eca 100644
--- a/apps/web/src/app/[locale]/(space)/account/preferences/components/date-time-preferences.tsx
+++ b/apps/web/src/app/[locale]/(space)/account/preferences/components/date-time-preferences.tsx
@@ -104,8 +104,7 @@ const DateTimePreferencesForm = () => {
</SelectTrigger>
<SelectContent>
{dayjs.weekdays().map((day, index) => (
- // biome-ignore lint/suspicious/noArrayIndexKey: Fix this later
- <SelectItem key={index} value={index.toString()}>
+ <SelectItem key={day} value={index.toString()}>
{day}
</SelectItem>
))}
diff --git a/apps/web/src/contexts/preferences.tsx b/apps/web/src/contexts/preferences.tsx
index 10c7c5690..136a8dd6c 100644
--- a/apps/web/src/contexts/preferences.tsx
+++ b/apps/web/src/contexts/preferences.tsx
@@ -46,7 +46,13 @@ export const PreferencesProvider = ({
{
raw: false,
serializer: JSON.stringify,
- deserializer: (value) => preferencesSchema.parse(JSON.parse(value)),
+ deserializer: (value) => {
+ try {
+ return preferencesSchema.parse(JSON.parse(value));
+ } catch {
+ return {};
+ }
+ },
},
);