0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 06:42:45 +00:00
This commit is contained in:
Trevor Buckner
2024-07-28 18:03:25 -04:00
parent 88eaebfd49
commit 8221579b6a
5 changed files with 74 additions and 74 deletions

View File

@@ -34,19 +34,19 @@ const printCurrentBrew = ()=>{
}
};
const fetchThemeBundle = async (obj, renderer, theme) => {
const fetchThemeBundle = async (obj, renderer, theme)=>{
const res = await request
.get(`/api/theme/${renderer}/${theme}`)
.catch((err) => {
obj.setState({ error: err });
.catch((err)=>{
obj.setState({ error: err });
});
if (!res) return;
if(!res) return;
const themeBundle = res.body;
themeBundle.joinedStyles = themeBundle.styles.map((style) => `<style>${style}</style>`).join('\n\n');
obj.setState((prevState) => ({
...prevState,
themeBundle: themeBundle
themeBundle.joinedStyles = themeBundle.styles.map((style)=>`<style>${style}</style>`).join('\n\n');
obj.setState((prevState)=>({
...prevState,
themeBundle : themeBundle
}));
};