Fix RoleColorEverywhere/ServerDrawer: TEXT_NORMAL is dead, use TEXT_DEFAULT

This commit is contained in:
Ally Founder 2026-08-02 18:35:19 -04:00
parent 3f4c2ca56d
commit b3b3ada661
2 changed files with 9 additions and 15 deletions

View file

@ -1,19 +1,10 @@
import { find, findByStoreName } from "@vendetta/metro";
import { semanticColors } from "@vendetta/ui";
import { resolveSemanticColorSafe } from "@shared/lib/color";
export { interpolateColor } from "@shared/lib/color";
export const ThemeStore = findByStoreName("ThemeStore");
export const resolveSemanticColor =
find((m: any) => m?.default?.internal?.resolveSemanticColor)?.default?.internal?.resolveSemanticColor ??
find((m: any) => m?.meta?.resolveSemanticColor)?.meta?.resolveSemanticColor ??
(() => undefined);
// TEXT_NORMAL was a bare, un-guarded reference here (confirmed dead via Key Inspector - Discord
// renamed its whole semanticColors scheme, TEXT_NORMAL -> TEXT_DEFAULT among others), unlike every
// other token lookup in this repo which already goes through a multi-candidate fallback chain.
export function defaultTextColor(): string | undefined {
try {
return resolveSemanticColor(ThemeStore?.theme, semanticColors.TEXT_NORMAL);
} catch {
return undefined;
}
return resolveSemanticColorSafe(["TEXT_NORMAL", "TEXT_DEFAULT"], "#dbdee1");
}

View file

@ -11,7 +11,10 @@ const getExpandedGuildFolderStore = lazy(() => rawFindByStoreName("ExpandedGuild
export function useTheme() {
const colors = getColorModule()?.colors;
return {
text: colors?.TEXT_NORMAL ?? "#dbdee1",
// TEXT_NORMAL is confirmed dead via Key Inspector (Discord renamed its whole semanticColors
// scheme) - TEXT_DEFAULT is its current replacement, kept alongside the old name in case an
// older Discord build is still in use.
text: colors?.TEXT_NORMAL ?? colors?.TEXT_DEFAULT ?? "#dbdee1",
folder: "#5865f2",
hover: colors?.STATE_LAYER_PRESS ?? "rgba(255,255,255,0.06)",
};