From 3a72d03f9e9110b4163bb202a30f620865dd8ff6 Mon Sep 17 00:00:00 2001 From: pa Date: Tue, 6 Jan 2026 12:21:14 +0900 Subject: [PATCH] feat: add ramdon user colours custom function --- src/stores/settings/appearance.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/stores/settings/appearance.js b/src/stores/settings/appearance.js index c0f93e13..152e985f 100644 --- a/src/stores/settings/appearance.js +++ b/src/stores/settings/appearance.js @@ -363,10 +363,19 @@ export const useAppearanceSettingsStore = defineStore( updateTrustColorClasses(trustColor.value); } - async function userColourInit() { - let dictObject = await AppApi.GetColourBulk( - Array.from(userStore.cachedUsers.keys()) - ); + async function userColourInit(customFunc) { + let dictObject = null; + if (typeof customFunc === 'function') { + dictObject = customFunc(userStore.cachedUsers.keys()); + } else { + dictObject = await AppApi.GetColourBulk( + Array.from(userStore.cachedUsers.keys()) + ); + } + if (!dictObject) { + console.warn('No user colour data found'); + return; + } if (LINUX) { // @ts-ignore dictObject = Object.fromEntries(dictObject);