Skip to content

Commit 0028d53

Browse files
committed
fix(web): keep theme picker stable during lookup and storage failures
1 parent df37768 commit 0028d53

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/web/src/components/CommandPalette.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,8 @@ function OpenCommandPaletteDialog(props: {
18971897
if (openIntent?.kind !== "change-theme") return;
18981898
clearOpenIntent();
18991899
browseNavigation.invalidate();
1900+
cloneLookupGeneration.current += 1;
1901+
setIsRemoteProjectLookingUp(false);
19001902
setAddProjectCloneFlow(null);
19011903
setViewStack([]);
19021904
pushPaletteView({

‎apps/web/src/themePalette.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,11 @@ export function invalidateCustomThemes() {
238238
notifyCustomThemeListeners();
239239
}
240240

241+
const EMPTY_CUSTOM_THEMES: ReadonlyArray<ThemeDefinition> = [];
242+
241243
export function getCustomThemes(): ReadonlyArray<ThemeDefinition> {
242244
const snapshot = getCustomThemeLibrarySnapshot();
243-
return snapshot.status === "ready" ? snapshot.themes : [];
245+
return snapshot.status === "ready" ? snapshot.themes : EMPTY_CUSTOM_THEMES;
244246
}
245247

246248
export function getEnvironmentThemes(): ReadonlyArray<ThemeDefinition> {

0 commit comments

Comments
 (0)