build: fix selfhost config (#5930)

This commit is contained in:
LongYinan
2024-02-28 04:17:29 +00:00
parent a0364dd4ea
commit 9e09166452

View File

@@ -21,12 +21,12 @@ class CustomAttachmentService extends AttachmentService {
} }
function customLoadFonts(service: PageService): void { function customLoadFonts(service: PageService): void {
const officialDomains = new Set(['affine.pro', 'affine.fail']); const officialDomains = new Set(['app.affine.pro', 'affine.fail']);
if (!officialDomains.has(window.location.host)) { if (!officialDomains.has(window.location.host)) {
const fonts = CanvasTextFonts.map(font => ({ const fonts = CanvasTextFonts.map(font => ({
...font, ...font,
// self-hosted fonts are served from /assets // self-hosted fonts are served from /assets
url: '/assets' + new URL(font.url).pathname.split('/').pop(), url: '/assets/' + new URL(font.url).pathname.split('/').pop(),
})); }));
service.fontLoader.load(fonts); service.fontLoader.load(fonts);
} else { } else {