mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 09:22:38 +00:00
No need to stringify Theme Bundle object
This commit is contained in:
@@ -297,8 +297,8 @@ const api = {
|
|||||||
snippets : completeSnippets.reverse()
|
snippets : completeSnippets.reverse()
|
||||||
};
|
};
|
||||||
|
|
||||||
res.setHeader('Content-Type', 'text/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
return res.status(200).send(JSON.stringify(returnObj));
|
return res.status(200).send(returnObj);
|
||||||
},
|
},
|
||||||
//Return CSS for a brew theme, with @include endpoint for its parent theme if any
|
//Return CSS for a brew theme, with @include endpoint for its parent theme if any
|
||||||
getBrewThemeCSS : async (req, res)=>{
|
getBrewThemeCSS : async (req, res)=>{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const printCurrentBrew = ()=>{
|
|||||||
const fetchThemeBundle = (obj, renderer, theme)=>{
|
const fetchThemeBundle = (obj, renderer, theme)=>{
|
||||||
fetch(`${window.location.protocol}//${window.location.host}/theme/${renderer}/${theme}`).then((response)=>response.json()).then((themeBundle)=>{
|
fetch(`${window.location.protocol}//${window.location.host}/theme/${renderer}/${theme}`).then((response)=>response.json()).then((themeBundle)=>{
|
||||||
themeBundle.joinedStyles = themeBundle.styles.map((style)=>`<style>${style}</style>`).join('\n\n'); //DOMPurify.sanitize(joinedStyles, purifyConfig);
|
themeBundle.joinedStyles = themeBundle.styles.map((style)=>`<style>${style}</style>`).join('\n\n'); //DOMPurify.sanitize(joinedStyles, purifyConfig);
|
||||||
obj.setState((prevState)=>({ // MOVE TO MOUNT STEP OF SHARE / NEW / EDIT
|
obj.setState((prevState)=>({
|
||||||
...prevState,
|
...prevState,
|
||||||
themeBundle : themeBundle
|
themeBundle : themeBundle
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user