aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/plugins/store.ts
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-10-20 22:30:49 +0200
committerGitHub <noreply@github.com>2022-10-20 22:30:49 +0200
commit31f26c4dd4a92bb5826ad2af9ccb9808fca40e40 (patch)
tree6ec4bfbca57658543e0cf6d610af1c21f2de106c /src-vue/src/plugins/store.ts
parent9b4e032b73e3f40c8c4126a25356f467a833d239 (diff)
parent2e5c9b034d6bd7aa6fddc7f7f75be071b30b9c5a (diff)
downloadFlightCore-31f26c4dd4a92bb5826ad2af9ccb9808fca40e40.tar.gz
FlightCore-31f26c4dd4a92bb5826ad2af9ccb9808fca40e40.zip
Merge pull request #25 from Alystrasz/refactor/router-view
refactor: Router view
Diffstat (limited to 'src-vue/src/plugins/store.ts')
-rw-r--r--src-vue/src/plugins/store.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index ce0b0ded..4fdf50a3 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -10,12 +10,12 @@ import { NorthstarState } from '../utils/NorthstarState';
import { appDir } from '@tauri-apps/api/path';
import { open } from '@tauri-apps/api/dialog';
import { Store } from 'tauri-plugin-store-api';
+import {router} from "../main";
const persistentStore = new Store('flight-core-settings.json');
export interface FlightCoreStore {
- current_tab: Tabs,
developer_mode: boolean,
game_path: string,
install_type: InstallType,
@@ -35,7 +35,6 @@ let notification_handle: NotificationHandle;
export const store = createStore<FlightCoreStore>({
state (): FlightCoreStore {
return {
- current_tab: Tabs.PLAY,
developer_mode: false,
game_path: undefined as unknown as string,
install_type: undefined as unknown as InstallType,
@@ -68,7 +67,7 @@ export const store = createStore<FlightCoreStore>({
_initializeListeners(state);
},
updateCurrentTab(state: any, newTab: Tabs) {
- state.current_tab = newTab;
+ router.push({path: newTab});
},
async updateGamePath(state: FlightCoreStore) {
// Open a selection dialog for directories