From b7682db9a31da7b2cf828555a16e2448aaafe267 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 22 Oct 2025 06:56:00 -0700 Subject: [PATCH] Remove duplicate themes in getThemes function --- src-web/lib/theme/themes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src-web/lib/theme/themes.ts b/src-web/lib/theme/themes.ts index ebeac079..ce84f842 100644 --- a/src-web/lib/theme/themes.ts +++ b/src-web/lib/theme/themes.ts @@ -6,7 +6,9 @@ import { resolveAppearance } from './appearance'; export async function getThemes() { const themes = (await invokeCmd('cmd_get_themes')).flatMap((t) => t.themes); themes.sort((a, b) => a.label.localeCompare(b.label)); - return { themes: [yaakDark, yaakLight, ...themes] }; + // Remove duplicates, in case multiple plugins provide the same theme + const uniqueThemes = Array.from(new Map(themes.map((t) => [t.id, t])).values()); + return { themes: [yaakDark, yaakLight, ...uniqueThemes] }; } export async function getResolvedTheme(