diff --git a/src/store/RouteStore.ts b/src/store/RouteStore.ts index 71cfde5..1cb166a 100644 --- a/src/store/RouteStore.ts +++ b/src/store/RouteStore.ts @@ -4,11 +4,17 @@ export interface RouteState { path: string } -export default configureStore({ +const store = configureStore({ reducer: { path: (state = '/load', action) => { if (action.type != 'setPath') return state; return action.path ?? state; } }, -}) \ No newline at end of file +}); + +export default store; + +export function route(path) { + store.dispatch({ type: 'setPath', path }); +} \ No newline at end of file diff --git a/src/widget/Titlebar/Titlebar.svelte b/src/widget/Titlebar/Titlebar.svelte index 62899e8..b377dad 100644 --- a/src/widget/Titlebar/Titlebar.svelte +++ b/src/widget/Titlebar/Titlebar.svelte @@ -10,6 +10,7 @@ import { appWindow } from '@tauri-apps/api/window' import Blek from '../../shared/blek.svelte'; + import { route } from '../../store/RouteStore';