aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/SettingsView.vue
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2022-10-20 10:12:36 +0200
committerGitHub <noreply@github.com>2022-10-20 10:12:36 +0200
commit2e5c9b034d6bd7aa6fddc7f7f75be071b30b9c5a (patch)
tree6ec4bfbca57658543e0cf6d610af1c21f2de106c /src-vue/src/views/SettingsView.vue
parent8edfb16aba17f082a3a0da891d8e49658bf36530 (diff)
parent9b4e032b73e3f40c8c4126a25356f467a833d239 (diff)
downloadFlightCore-2e5c9b034d6bd7aa6fddc7f7f75be071b30b9c5a.tar.gz
FlightCore-2e5c9b034d6bd7aa6fddc7f7f75be071b30b9c5a.zip
Merge branch 'GeckoEidechse:main' into refactor/router-view
Diffstat (limited to 'src-vue/src/views/SettingsView.vue')
-rw-r--r--src-vue/src/views/SettingsView.vue36
1 files changed, 1 insertions, 35 deletions
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index ec63bd6e..0b0e52e4 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -21,11 +21,7 @@
</template>
<script lang="ts">
-import { open } from '@tauri-apps/api/dialog';
-import { appDir } from '@tauri-apps/api/path';
-import { invoke } from "@tauri-apps/api";
import { defineComponent } from "vue";
-import { ElNotification } from 'element-plus';
export default defineComponent({
name: "SettingsView",
@@ -36,37 +32,7 @@ export default defineComponent({
},
methods: {
async updateGamePath() {
- // Open a selection dialog for directories
- const selected = await open({
- directory: true,
- multiple: false,
- defaultPath: await appDir(),
- });
- if (Array.isArray(selected)) {
- // user selected multiple directories
- alert("Please only select a single directory");
- } else if (selected === null) {
- // user cancelled the selection
- } else {
- // user selected a single directory
-
- // Verify if valid Titanfall2 install location
- let is_valid_titanfall2_install = await invoke("verify_install_location", { gamePath: selected }) as boolean;
- if (is_valid_titanfall2_install) {
- this.$store.state.game_path = selected;
- // Check for Northstar install
- this.$store.commit('checkNorthstarUpdates');
- }
- else {
- // Not valid Titanfall2 install
- ElNotification({
- title: 'Wrong folder',
- message: "Selected folder is not a valid Titanfall2 install.",
- type: 'error',
- position: 'bottom-right'
- });
- }
- }
+ this.$store.commit('updateGamePath');
}
},
mounted() {