Fix undefined window error

This commit is contained in:
Daniel Kluge 2022-10-08 13:27:33 +02:00
parent 7f07e915de
commit 84057788b3

View File

@ -10,7 +10,7 @@ const projectServerErrorHtml = `<div class="${"error"}">Sorry! A server error ha
const ad = asciidoctor(); const ad = asciidoctor();
const isDev = window?.location?.host.startsWith("dev") || false; const isDev = typeof window !== "undefined" ? window.location.host.startsWith("dev") : false;
export async function generateContent(content: Project|Diary, selectedPage?: number): Promise<string> { export async function generateContent(content: Project|Diary, selectedPage?: number): Promise<string> {
if(!content) return projectEmpty; if(!content) return projectEmpty;