Fix fonts loading for desktop

This commit is contained in:
Hakan Shehu
2025-01-21 13:33:21 +01:00
parent 9bb5a5d388
commit dff5a2257f

View File

@@ -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 });
};