diff --git a/src/renderer/components/BottomBar.tsx b/src/renderer/components/BottomBar.tsx index 92360d7..4ca8cff 100644 --- a/src/renderer/components/BottomBar.tsx +++ b/src/renderer/components/BottomBar.tsx @@ -49,6 +49,7 @@ export default function BottomBar({ onClose, onHeightChange }: BottomBarProps): const rootRef = useRef(null) const [astraBaseUrlInput, setAstraBaseUrlInput] = useState('') const [astraTokenInput, setAstraTokenInput] = useState('') + const [isRefreshingThemes, setIsRefreshingThemes] = useState(false) const hiddenScopes = useSettingsStore((s) => s.hiddenScopes) const scopeOrder = useSettingsStore((s) => s.scopeOrder) @@ -61,6 +62,7 @@ export default function BottomBar({ onClose, onHeightChange }: BottomBarProps): themes, activeThemeId, loadTheme, + reloadThemes, showThemesFolder, } = useThemeStore() const astraState = useAstraStore((s) => s.integrationState) @@ -215,6 +217,25 @@ export default function BottomBar({ onClose, onHeightChange }: BottomBarProps): } } + const handleReloadThemes = async (): Promise => { + if (isRefreshingThemes) { + return + } + + setIsRefreshingThemes(true) + try { + await reloadThemes() + } catch (error) { + showBanner({ + tone: 'error', + message: getErrorMessage(error, 'Could not refresh themes.'), + actions: [], + }) + } finally { + setIsRefreshingThemes(false) + } + } + const handleRailWheel = (event: WheelEvent): void => { const railElement = event.currentTarget const target = event.target @@ -295,6 +316,16 @@ export default function BottomBar({ onClose, onHeightChange }: BottomBarProps): ))} +