diff --git a/apps/onelauncher/frontend/src/components/Navbar.tsx b/apps/onelauncher/frontend/src/components/Navbar.tsx index e5ab57d7..9009e5c4 100644 --- a/apps/onelauncher/frontend/src/components/Navbar.tsx +++ b/apps/onelauncher/frontend/src/components/Navbar.tsx @@ -1,5 +1,6 @@ import type { ToOptions } from '@tanstack/react-router'; import { bindings } from '@/main'; +import useNotifications from '@/hooks/useNotification'; import { useCommand } from '@onelauncher/common'; import { Button, Menu } from '@onelauncher/common/components'; import { Link } from '@tanstack/react-router'; @@ -8,9 +9,12 @@ import { MenuTrigger } from 'react-aria-components'; import OneLauncherText from '../assets/logos/onelauncher_text.svg'; import PlayerHead from './content/PlayerHead'; import AccountPopup from './overlay/popups/AccountPopup'; +import NotificationPopup from './overlay/popups/NotificationPopup'; function Navbar() { const defaultUser = useCommand('getDefaultUser', () => bindings.core.getDefaultUser(false)); + const { list } = useNotifications(); + const notificationCount = Object.keys(list).length; return (
{name}
++ {name} +
{mc_loader}
{' '}
diff --git a/apps/onelauncher/frontend/src/routes/app/settings/index.tsx b/apps/onelauncher/frontend/src/routes/app/settings/index.tsx
index 6b754f2c..4e41866e 100644
--- a/apps/onelauncher/frontend/src/routes/app/settings/index.tsx
+++ b/apps/onelauncher/frontend/src/routes/app/settings/index.tsx
@@ -1,5 +1,6 @@
import DiscordIcon from '@/assets/logos/discord.svg';
import SettingsRow from '@/components/SettingsRow';
+import usePopState from '@/hooks/usePopState';
import { bindings } from '@/main';
import { useCommand } from '@onelauncher/common';
import { Button, Switch } from '@onelauncher/common/components';
@@ -14,7 +15,16 @@ export const Route = createFileRoute('/app/settings/')({
});
function RouteComponent() {
- const _result = useCommand('getGlobalProfile', bindings.core.getGlobalProfile);
+ const result = useCommand('readSettings', bindings.core.readSettings);
+
+ const save = useCommand('writeSettings', () => bindings.core.writeSettings(result.data!), {
+ enabled: false,
+ subscribed: false,
+ });
+
+ usePopState(() => {
+ save.refetch();
+ });
const openLauncherDir = async () => {
const dir = await dataDir();
@@ -32,7 +42,13 @@ function RouteComponent() {
icon={}
title="Discord RPC"
>
-
Minecraft Settings
-