fix(frontend): fallback empty offline page html to default template in preview

This commit is contained in:
ryan
2026-08-08 21:52:02 +08:00
parent fda727cf53
commit c4be34b214
3 changed files with 20 additions and 3 deletions
@@ -35,6 +35,13 @@ export const OFFLINE_PAGE_TEMPLATES: OfflinePageTemplate[] = [
/** 默认预制模板 */
export const DEFAULT_OFFLINE_PAGE_TEMPLATE_ID = 'minimalist';
export const DEFAULT_OFFLINE_PAGE_HTML =
getOfflinePageTemplate(DEFAULT_OFFLINE_PAGE_TEMPLATE_ID)?.html ?? '';
export function effectiveOfflinePageHTML(html: string): string {
return html.trim() === '' ? DEFAULT_OFFLINE_PAGE_HTML : html;
}
export function getOfflinePageTemplate(
id: string,
): OfflinePageTemplate | undefined {