diff options
author | Alystrasz <contact@remyraes.com> | 2022-09-26 18:36:00 +0200 |
---|---|---|
committer | Alystrasz <contact@remyraes.com> | 2022-09-26 18:36:00 +0200 |
commit | 13de634cff40efb0180ee0e440cefe9e1bcf2da1 (patch) | |
tree | f5d2f33008b2cb1a46c519782f550a22c9b3d46e | |
parent | 634a0581c68e01d7f5155f369e1350010e7f7e91 (diff) | |
download | FlightCore-13de634cff40efb0180ee0e440cefe9e1bcf2da1.tar.gz FlightCore-13de634cff40efb0180ee0e440cefe9e1bcf2da1.zip |
docs: add documentation to store methods
-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) { |