0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 21:22:39 +00:00

Display name of write in theme next to write-in

Clear user's active ThemeBundle when an incomplete/broken/invalid writein.

Needs theming help.
This commit is contained in:
David Bolack
2025-01-07 22:11:01 -06:00
parent e7f8cda6ae
commit 74122d9057
6 changed files with 32 additions and 8 deletions

View File

@@ -44,8 +44,13 @@ const fetchThemeBundle = async (obj, renderer, theme)=>{
.catch((err)=>{
obj.setState({ error: err });
});
if(!res) return;
if(!res) {
obj.setState((prevState)=>({
...prevState,
themeBundle : {}
}));
return;
}
const themeBundle = res.body;
themeBundle.joinedStyles = themeBundle.styles.map((style)=>`<style>${style}</style>`).join('\n\n');
obj.setState((prevState)=>({
@@ -54,8 +59,14 @@ const fetchThemeBundle = async (obj, renderer, theme)=>{
}));
};
const fetchBrewAsThemeJSON = async (renderer, theme)=>{
if(!renderer || !theme) return;
}
export {
splitTextStyleAndMetadata,
printCurrentBrew,
fetchThemeBundle,
fetchBrewAsThemeJSON
};