aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-tauri/bindings/InstallType.ts3
-rw-r--r--src-tauri/src/main.rs3
-rw-r--r--src-vue/src/plugins/store.ts4
-rw-r--r--src-vue/src/utils/InstallType.ts8
4 files changed, 7 insertions, 11 deletions
diff --git a/src-tauri/bindings/InstallType.ts b/src-tauri/bindings/InstallType.ts
new file mode 100644
index 00000000..2a0f9a7f
--- /dev/null
+++ b/src-tauri/bindings/InstallType.ts
@@ -0,0 +1,3 @@
+// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
+
+export type InstallType = "STEAM" | "ORIGIN" | "EAPLAY" | "UNKNOWN"; \ No newline at end of file
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 9e812683..a7827a44 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -457,7 +457,8 @@ mod platform_specific;
#[cfg(target_os = "linux")]
use platform_specific::linux;
-#[derive(Serialize, Deserialize, Debug, Clone)]
+#[derive(Serialize, Deserialize, Debug, Clone, TS)]
+#[ts(export)]
pub enum InstallType {
STEAM,
ORIGIN,
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index 9865b992..e18498a6 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -1,7 +1,7 @@
import { createStore } from 'vuex';
import { listen, Event as TauriEvent } from "@tauri-apps/api/event";
import { Tabs } from "../utils/Tabs";
-import { InstallType } from "../utils/InstallType";
+import { InstallType } from "../../../src-tauri/bindings/InstallType";
import { invoke } from "@tauri-apps/api";
import { GameInstall } from "../utils/GameInstall";
import { ReleaseCanal } from "../utils/ReleaseCanal";
@@ -142,7 +142,7 @@ export const store = createStore<FlightCoreStore>({
catch {
console.warn("Nothing to close");
}
- state.game_install.install_type = InstallType.UNKNOWN;
+ state.game_install.install_type = "UNKNOWN";
// Save change in persistent store
await persistentStore.set('game-install', { value: state.game_install });
diff --git a/src-vue/src/utils/InstallType.ts b/src-vue/src/utils/InstallType.ts
deleted file mode 100644
index 797f4077..00000000
--- a/src-vue/src/utils/InstallType.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// Enumerates the way Titanfall2 could be installed (Steam/Origin/EA-Desktop)
-// Needs to be synced with `pub enum InstallType` in /src-tauri/src/lib.rs
-export enum InstallType {
- STEAM = 'STEAM',
- ORIGIN = 'ORIGIN',
- EAPLAY = 'EAPLAY',
- UNKNOWN = 'UNKNOWN', // used when the install location was manually selected
-}