From dc73f8e3b1da6f4e3ad26d01908ff9806ac31b37 Mon Sep 17 00:00:00 2001 From: Jake Date: Mon, 17 Jul 2023 20:35:45 +0200 Subject: [PATCH] fix: don't copy custom preferences to default preferences --- frontend/src/lib/components/PartialMemberCard.svelte | 2 +- frontend/src/lib/components/StatusIcon.svelte | 2 +- frontend/src/lib/components/StatusLine.svelte | 2 +- frontend/src/routes/@[username]/+page.svelte | 2 +- frontend/src/routes/@[username]/[memberName]/+page.svelte | 2 +- frontend/src/routes/edit/EditableName.svelte | 2 +- frontend/src/routes/edit/EditablePronouns.svelte | 2 +- frontend/src/routes/edit/FieldEntry.svelte | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/lib/components/PartialMemberCard.svelte b/frontend/src/lib/components/PartialMemberCard.svelte index fc2b3e4..4f57712 100644 --- a/frontend/src/lib/components/PartialMemberCard.svelte +++ b/frontend/src/lib/components/PartialMemberCard.svelte @@ -17,7 +17,7 @@ let pronouns: string | undefined; let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, user.custom_preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, user.custom_preferences); const getPronouns = (member: PartialMember) => { const filteredPronouns = member.pronouns.filter( diff --git a/frontend/src/lib/components/StatusIcon.svelte b/frontend/src/lib/components/StatusIcon.svelte index be4977c..824c894 100644 --- a/frontend/src/lib/components/StatusIcon.svelte +++ b/frontend/src/lib/components/StatusIcon.svelte @@ -9,7 +9,7 @@ export let className: string | null = null; let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, preferences); let currentPreference: CustomPreference; $: currentPreference = diff --git a/frontend/src/lib/components/StatusLine.svelte b/frontend/src/lib/components/StatusLine.svelte index 021326c..25e109b 100644 --- a/frontend/src/lib/components/StatusLine.svelte +++ b/frontend/src/lib/components/StatusLine.svelte @@ -9,7 +9,7 @@ export let status: string; let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, preferences); let currentPreference: CustomPreference; $: currentPreference = diff --git a/frontend/src/routes/@[username]/+page.svelte b/frontend/src/routes/@[username]/+page.svelte index 65230c7..a181ee7 100644 --- a/frontend/src/routes/@[username]/+page.svelte +++ b/frontend/src/routes/@[username]/+page.svelte @@ -96,7 +96,7 @@ }; let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, data.custom_preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, data.custom_preferences); let favNames: FieldEntry[]; $: favNames = data.names.filter( diff --git a/frontend/src/routes/@[username]/[memberName]/+page.svelte b/frontend/src/routes/@[username]/[memberName]/+page.svelte index ddc5112..504448a 100644 --- a/frontend/src/routes/@[username]/[memberName]/+page.svelte +++ b/frontend/src/routes/@[username]/[memberName]/+page.svelte @@ -29,7 +29,7 @@ $: bio = renderMarkdown(data.bio); let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, data.user.custom_preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, data.user.custom_preferences); let favNames: FieldEntry[]; $: favNames = data.names.filter( diff --git a/frontend/src/routes/edit/EditableName.svelte b/frontend/src/routes/edit/EditableName.svelte index 1e12599..09e4c8c 100644 --- a/frontend/src/routes/edit/EditableName.svelte +++ b/frontend/src/routes/edit/EditableName.svelte @@ -21,7 +21,7 @@ let buttonElement: HTMLElement; let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, preferences); let currentPreference: CustomPreference; $: currentPreference = diff --git a/frontend/src/routes/edit/EditablePronouns.svelte b/frontend/src/routes/edit/EditablePronouns.svelte index 5179a81..946851e 100644 --- a/frontend/src/routes/edit/EditablePronouns.svelte +++ b/frontend/src/routes/edit/EditablePronouns.svelte @@ -25,7 +25,7 @@ const toggleDisplay = () => (displayOpen = !displayOpen); let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, preferences); let currentPreference: CustomPreference; $: currentPreference = diff --git a/frontend/src/routes/edit/FieldEntry.svelte b/frontend/src/routes/edit/FieldEntry.svelte index 2a9b086..1f4aa61 100644 --- a/frontend/src/routes/edit/FieldEntry.svelte +++ b/frontend/src/routes/edit/FieldEntry.svelte @@ -21,7 +21,7 @@ let buttonElement: HTMLElement; let mergedPreferences: CustomPreferences; - $: mergedPreferences = Object.assign(defaultPreferences, preferences); + $: mergedPreferences = Object.assign({}, defaultPreferences, preferences); let currentPreference: CustomPreference; $: currentPreference =