Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Fix fonts loading for desktop

Hakan Shehudff5a2257fd2
diff --git a/apps/desktop/src/main/lib/protocols.ts b/apps/desktop/src/main/lib/protocols.ts
index cc7199d6..9780a65b 100644
--- a/apps/desktop/src/main/lib/protocols.ts
+++ b/apps/desktop/src/main/lib/protocols.ts
@@ -4,6 +4,7 @@ import path from 'path';
import {
getAccountAvatarsDirectoryPath,
+ getAssetsSourcePath,
getWorkspaceFilesDirectoryPath,
} from '@/main/lib/utils';
import { appService } from '@/main/services/app-service';
@@ -50,6 +51,12 @@ export const handleAssetRequest = async (
}
}
+ if (type === 'fonts') {
+ const filePath = path.join(getAssetsSourcePath(), 'fonts', id);
+ const fileUrl = `file://${filePath}`;
+ return net.fetch(fileUrl);
+ }
+
return new Response(null, { status: 404 });
};