refactor(admin-permissions, reports): normalize admin account kind and improve currency fallback logic
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
Some checks failed
lotteryadmin CI / build (push) Has been cancelled
Refactored the admin account kind resolution to utilize a normalization function for better consistency across the application. Updated the currency fallback logic in the reports console to prioritize enabled and bettable currencies, enhancing the accuracy of currency display.
This commit is contained in:
@@ -238,7 +238,7 @@ function resolveDisplayCurrency(apiCode?: string | null): string {
|
||||
if (trimmed) {
|
||||
return trimmed;
|
||||
}
|
||||
const fallback = getCachedAdminCurrencies().find((row) => row.is_default)?.code;
|
||||
const fallback = getCachedAdminCurrencies().find((row) => row.is_enabled && row.is_bettable)?.code;
|
||||
return fallback?.trim() || "NPR";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user