Skip to content

Commit

Permalink
Start catching tauri stuff (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImUrX authored Feb 17, 2023
1 parent 1f25d9c commit c64d9b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions gui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,18 @@ export default function App() {
const { l10n } = useLocalization();

useEffect(() => {
os.type().then((type) => {
document.body.classList.add(type.toLowerCase());
});
os.type()
.then((type) => {
document.body.classList.add(type.toLowerCase());
})
.catch(console.error);

return () => {
os.type().then((type) => {
document.body.classList.remove(type.toLowerCase());
});
os.type()
.then((type) => {
document.body.classList.remove(type.toLowerCase());
})
.catch(console.error);
};
}, []);

Expand Down
2 changes: 1 addition & 1 deletion gui/src/i18n/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const langs = [
// only on launch :P
const overrideLangExists = exists(OVERRIDE_FILENAME, {
dir: BaseDirectory.AppConfig,
});
}).catch(() => false);

// Fetch translation file
async function fetchMessages(locale: string): Promise<[string, string]> {
Expand Down

0 comments on commit c64d9b9

Please sign in to comment.