Fix "[object Promise]" appearing in HTML exports (#9975)

Fixes https://github.com/vector-im/element-web/issues/24272
This commit is contained in:
Clark Fischer
2023-01-30 14:31:32 +00:00
committed by GitHub
parent 3e2bf5640e
commit 4c1e4f5127
13 changed files with 895 additions and 84 deletions

View File

@@ -58,8 +58,8 @@ const getExportCSS = async (usedClasses: Set<string>): Promise<string> => {
// If the light theme isn't loaded we will have to fetch & parse it manually
if (!stylesheets.some(isLightTheme)) {
const href = document.querySelector<HTMLLinkElement>('link[rel="stylesheet"][href$="theme-light.css"]').href;
stylesheets.push(await getRulesFromCssFile(href));
const href = document.querySelector<HTMLLinkElement>('link[rel="stylesheet"][href$="theme-light.css"]')?.href;
if (href) stylesheets.push(await getRulesFromCssFile(href));
}
let css = "";