From 948c60d65655094f36606f2197233fbad70b376f Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 13 May 2025 00:18:15 +0200 Subject: [PATCH] FIX: do not error when no palettes are available (#160) To repro this you had to unchecked all the "Color palette can be selected by users" from the colors tab. --- .../discourse/components/user-color-palette-selector.gjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascripts/discourse/components/user-color-palette-selector.gjs b/javascripts/discourse/components/user-color-palette-selector.gjs index 58c01e9..fb4d358 100644 --- a/javascripts/discourse/components/user-color-palette-selector.gjs +++ b/javascripts/discourse/components/user-color-palette-selector.gjs @@ -38,7 +38,7 @@ export default class UserColorPaletteSelector extends Component { get userColorPalettes() { const availablePalettes = listColorSchemes(this.site) - .map((userPalette) => { + ?.map((userPalette) => { return { ...userPalette, accent: `#${ @@ -56,7 +56,7 @@ export default class UserColorPaletteSelector extends Component { // Match the light scheme with the corresponding dark id based in the name return ( availablePalettes - .map((palette) => { + ?.map((palette) => { if (palette.is_dark) { return palette; }