mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix(core): canvas font loading in desktop (#6025)
This commit is contained in:
@@ -145,6 +145,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
||||
: buildFlags.mode === 'development'
|
||||
? true
|
||||
: currentBuildPreset.allowLocalWorkspace,
|
||||
isSelfHosted: process.env.SELF_HOSTED === 'true',
|
||||
};
|
||||
|
||||
const testEnvironmentPreset = {
|
||||
|
||||
@@ -21,8 +21,7 @@ class CustomAttachmentService extends AttachmentService {
|
||||
}
|
||||
|
||||
function customLoadFonts(service: RootService): void {
|
||||
const officialDomains = new Set(['app.affine.pro', 'affine.fail']);
|
||||
if (!officialDomains.has(window.location.host)) {
|
||||
if (runtimeConfig.isSelfHosted) {
|
||||
const fonts = CanvasTextFonts.map(font => ({
|
||||
...font,
|
||||
// self-hosted fonts are served from /assets
|
||||
|
||||
Reference in New Issue
Block a user