diff --git a/frontend/src/routes/@[username]/+page.svelte b/frontend/src/routes/@[username]/+page.svelte
index 6d7cb2c..07d072c 100644
--- a/frontend/src/routes/@[username]/+page.svelte
+++ b/frontend/src/routes/@[username]/+page.svelte
@@ -20,10 +20,12 @@
MAX_MEMBERS,
pronounDisplay,
userAvatars,
- WordStatus,
type APIError,
type Member,
type PartialMember,
+ type CustomPreferences,
+ type FieldEntry,
+ type Pronoun,
} from "$lib/api/entities";
import { PUBLIC_BASE_URL } from "$env/static/public";
import { apiFetchClient } from "$lib/api/fetch";
@@ -34,6 +36,7 @@
import ProfileLink from "./ProfileLink.svelte";
import { memberNameRegex } from "$lib/api/regex";
import StatusLine from "$lib/components/StatusLine.svelte";
+ import defaultPreferences from "$lib/api/default_preferences";
export let data: PageData;
@@ -84,8 +87,17 @@
}
};
- const favNames = data.names.filter((entry) => entry.status === WordStatus.Favourite);
- const favPronouns = data.pronouns.filter((entry) => entry.status === WordStatus.Favourite);
+ let mergedPreferences: CustomPreferences;
+ $: mergedPreferences = Object.assign(defaultPreferences, data.custom_preferences);
+
+ let favNames: FieldEntry[];
+ $: favNames = data.names.filter(
+ (entry) => (mergedPreferences[entry.status] || { favourite: false }).favourite,
+ );
+ let favPronouns: Pronoun[];
+ $: favPronouns = data.pronouns.filter(
+ (entry) => (mergedPreferences[entry.status] || { favourite: false }).favourite,
+ );
let profileEmpty = false;
$: profileEmpty =
@@ -146,7 +158,11 @@
Names
{#each data.names as name}
- - {name.value}
+ -
+ {name.value}
+
{/each}
@@ -156,7 +172,11 @@
Pronouns
{#each data.pronouns as pronouns}
-
+ -
+
+
{/each}
diff --git a/frontend/src/routes/@[username]/[memberName]/+page.svelte b/frontend/src/routes/@[username]/[memberName]/+page.svelte
index 7ef25d9..a90ff5e 100644
--- a/frontend/src/routes/@[username]/[memberName]/+page.svelte
+++ b/frontend/src/routes/@[username]/[memberName]/+page.svelte
@@ -2,25 +2,40 @@
import FieldCard from "$lib/components/FieldCard.svelte";
import type { PageData } from "./$types";
- import StatusIcon from "$lib/components/StatusIcon.svelte";
import PronounLink from "$lib/components/PronounLink.svelte";
import FallbackImage from "$lib/components/FallbackImage.svelte";
import { Alert, Button, Icon } from "sveltestrap";
- import { memberAvatars, pronounDisplay, WordStatus } from "$lib/api/entities";
+ import {
+ memberAvatars,
+ pronounDisplay,
+ type CustomPreferences,
+ type FieldEntry,
+ type Pronoun,
+ } from "$lib/api/entities";
import { PUBLIC_BASE_URL } from "$env/static/public";
import { userStore } from "$lib/store";
import { renderMarkdown } from "$lib/utils";
import ReportButton from "../ReportButton.svelte";
import ProfileLink from "../ProfileLink.svelte";
import StatusLine from "$lib/components/StatusLine.svelte";
+ import defaultPreferences from "$lib/api/default_preferences";
export let data: PageData;
let bio: string | null;
$: bio = renderMarkdown(data.bio);
- const favNames = data.names.filter((entry) => entry.status === WordStatus.Favourite);
- const favPronouns = data.pronouns.filter((entry) => entry.status === WordStatus.Favourite);
+ let mergedPreferences: CustomPreferences;
+ $: mergedPreferences = Object.assign(defaultPreferences, data.user.custom_preferences);
+
+ let favNames: FieldEntry[];
+ $: favNames = data.names.filter(
+ (entry) => (mergedPreferences[entry.status] || { favourite: false }).favourite,
+ );
+ let favPronouns: Pronoun[];
+ $: favPronouns = data.pronouns.filter(
+ (entry) => (mergedPreferences[entry.status] || { favourite: false }).favourite,
+ );
let profileEmpty = false;
$: profileEmpty =
@@ -81,7 +96,11 @@
Names
{#each data.names as name}
- - {name.value}
+ -
+ {name.value}
+
{/each}
@@ -91,7 +110,11 @@
Pronouns
{#each data.pronouns as pronouns}
-
+ -
+
+
{/each}