diff options
Diffstat (limited to 'src-vue/src')
-rw-r--r-- | src-vue/src/plugins/store.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 98ad2342..0d5d8893 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -33,7 +33,10 @@ export const store = createStore({ } }); - +/** + * This is called when application root component has been mounted. + * It invokes all Rust methods that are needed to initialize UI. + */ async function _initializeApp(state: any) { const result: GameInstall = await invoke("find_game_install_location_caller") .catch((err) => { @@ -55,6 +58,10 @@ async function _checkForFlightCoreUpdates(state: any) { let flightcore_is_outdated = await invoke("check_is_flightcore_outdated_caller") as boolean; } +/** + * This registers callbacks listening to events from Rust-backend. + * Those events include Origin and Northstar running state. + */ function _initializeListeners(state: any) { listen("origin-running-ping", function (evt: TauriEvent<any>) { state.origin_is_running = evt.payload as boolean; @@ -65,6 +72,10 @@ function _initializeListeners(state: any) { }); } +/** + * This retrieves Northstar version tag, and stores it in application + * state, for it to be displayed in UI. + */ async function _get_northstar_version_number_and_set_button_accordingly(state: any) { let northstar_version_number: string = await invoke("get_northstar_version_number_caller", { gamePath: state.game_path }); if (northstar_version_number && northstar_version_number.length > 0) { |