aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Database')
-rw-r--r--src/lib/Database/userPreferences.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/Database/userPreferences.ts b/src/lib/Database/userPreferences.ts
index c3ef5c04..ca2d62be 100644
--- a/src/lib/Database/userPreferences.ts
+++ b/src/lib/Database/userPreferences.ts
@@ -9,7 +9,7 @@ export interface UserPreferences {
biography: string | null;
badge_wall_css: string;
hide_awc_badges: boolean;
- pinned_badge_wall_categories: string;
+ pinned_badge_wall_categories: string[];
}
interface NewUserPreferences {
@@ -19,7 +19,7 @@ interface NewUserPreferences {
badge_wall_css?: string;
biography?: string;
hide_awc_badges?: boolean;
- pinned_badge_wall_categories?: string;
+ pinned_badge_wall_categories?: string[];
}
export const getUserPreferences = async (userId: number) => {
@@ -126,7 +126,7 @@ export const togglePinnedBadgeWallCategory = async (userId: number, category: st
if (!userPreferences) return null;
- const pinnedCategories = userPreferences.pinned_badge_wall_categories.split(',');
+ const pinnedCategories = userPreferences.pinned_badge_wall_categories;
const index = pinnedCategories.indexOf(category);
if (index === -1) pinnedCategories.push(category);
@@ -137,11 +137,11 @@ export const togglePinnedBadgeWallCategory = async (userId: number, category: st
pinned_hololive_streams: userPreferences.pinned_hololive_streams,
hide_missing_badges: userPreferences.hide_missing_badges,
badge_wall_css: userPreferences.badge_wall_css,
- pinned_badge_wall_categories: pinnedCategories.join(',')
+ pinned_badge_wall_categories: pinnedCategories
});
};
-export const setPinnedBadgeWallCategories = async (userId: number, categories: string) => {
+export const setPinnedBadgeWallCategories = async (userId: number, categories: string[]) => {
const userPreferences = await getUserPreferences(userId);
if (!userPreferences) return null;