Skip to content

Commit

Permalink
Fix outdated custom font variables
Browse files Browse the repository at this point in the history
  • Loading branch information
OrigamingWasTaken committed Oct 5, 2024
1 parent 44892c2 commit 33bf0d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions frontend/src/windows/main/components/settings/panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/** Fires when a file is chosen from a filepicker */
fileChosen: { id: string; file: string };
/** Fires when a file is removed from a filepicker */
fileRemoved: null;
fileRemoved: { id: string };
/** Fires when an input changes */
input: { input: string };
/** Fires when a select item is chosen */
Expand Down Expand Up @@ -185,7 +185,9 @@
<div class="mt-5">
<!-- Category Description -->
<p class="text-xl font-bold text-primary">{category.name}</p>
<p class="text-[13px] text-primary saturate-[20%] brightness-200 font-semibold">{category.description}</p>
<p class="text-[13px] text-primary saturate-[20%] brightness-200 font-semibold">
{category.description}
</p>
{#each category.widgets || [] as widget (widget.id)}
<!-- Separator for the widgets (except button) -->
{#if widget.options.type !== 'button'}
Expand Down Expand Up @@ -258,7 +260,7 @@
}}
on:fileRemoved={() => {
settings[category.id][widget.id] = null;
dispatch('fileRemoved');
dispatch('fileRemoved', { id: widget.id });
updateSettings();
}}
/>
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/windows/main/pages/Mods.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
}
async function onFileAdded(e: CustomEvent) {
const { id, filePath } = e.detail;
const { id, file } = e.detail;
switch (id) {
case 'custom_font': {
const cachePath = path.join(await os.getEnv('HOME'), 'Library/Application Support/AppleBlox/.cache/fonts');
await shellFS.createDirectory(cachePath);
await filesystem.copy(filePath, path.join(cachePath, `CustomFont${path.extname(filePath)}`));
await filesystem.copy(file, path.join(cachePath, `CustomFont${path.extname(file)}`)).catch(console.error);
break;
}
}
Expand All @@ -55,7 +55,9 @@
const { id } = e.detail;
switch (id) {
case 'custom_font':
await os.execCommand('rm -f ~/"Library/Application Support/AppleBlox/.cache/fonts/CustomFont".*');
await shellFS.remove(path.join(await os.getEnv("HOME"),"Library","Application Support","AppleBlox/.cache/fonts/CustomFont.ttf"),{skipStderrCheck: true})
await shellFS.remove(path.join(await os.getEnv("HOME"),"Library","Application Support","AppleBlox/.cache/fonts/CustomFont.otf"),{skipStderrCheck: true})
await shellFS.remove(path.join(await os.getEnv("HOME"),"Library","Application Support","AppleBlox/.cache/fonts/CustomFont.ttc"),{skipStderrCheck: true})
break;
}
}
Expand Down

0 comments on commit 33bf0d4

Please sign in to comment.