fix custom path

This commit is contained in:
Kendall Garner 2025-07-12 07:21:34 -07:00
parent 746ab8c2d9
commit 92ed8e20c9
No known key found for this signature in database
GPG key ID: 9355F387FE765C94

View file

@ -22,6 +22,8 @@ import { FontType } from '/@/shared/types/types';
const localSettings = isElectron() ? window.api.localSettings : null;
const ipc = isElectron() ? window.api.ipc : null;
// Electron 32+ removed file.path, use this which is exposed in preload to get real path
const webUtils = isElectron() ? window.electron.webUtils : null;
type Font = {
label: string;
@ -254,7 +256,7 @@ export const ApplicationSettings = () => {
setSettings({
font: {
...fontSettings,
custom: e?.path ?? null,
custom: e ? webUtils?.getPathForFile(e) || null : null,
},
})
}