+ {#if _.isEqual(selectedOption, option)}
+
-
- {option}
+
+ {renderedOption.title}
{:else}
- {option}
+ {renderedOption.title}
{/if}
diff --git a/web/src/routes/(user)/albums/+page.svelte b/web/src/routes/(user)/albums/+page.svelte
index 06c1e7a32e..85ea4ba390 100644
--- a/web/src/routes/(user)/albums/+page.svelte
+++ b/web/src/routes/(user)/albums/+page.svelte
@@ -216,15 +216,20 @@
CourseInfo.sortTitle)}
- bind:value={$albumViewSettings.sortBy}
- icons={Object.keys(sortByOptions).map((key) => (sortByOptions[key].sortDesc ? ArrowDownThin : ArrowUpThin))}
+ options={Object.values(sortByOptions)}
+ render={(option) => {
+ return {
+ title: option.sortTitle,
+ icon: option.sortDesc ? ArrowDownThin : ArrowUpThin,
+ };
+ }}
on:select={(event) => {
for (const key in sortByOptions) {
- if (sortByOptions[key].sortTitle === event.detail) {
+ if (sortByOptions[key].sortTitle === event.detail.sortTitle) {
sortByOptions[key].sortDesc = !sortByOptions[key].sortDesc;
}
}
+ $albumViewSettings.sortBy = event.detail.sortTitle;
}}
/>