aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/DeveloperView.vue32
-rw-r--r--src-vue/src/views/SettingsView.vue36
2 files changed, 18 insertions, 50 deletions
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue
index 71e09e30..dcc0c477 100644
--- a/src-vue/src/views/DeveloperView.vue
+++ b/src-vue/src/views/DeveloperView.vue
@@ -50,22 +50,24 @@ export default defineComponent({
});
},
async checkLinuxCompatibility() {
- let LinuxCompatible = await invoke("linux_checks");
- if (!LinuxCompatible) {
- ElNotification({
- title: 'Not linux compatible',
- message: 'GLIBC is not version 2.33 or greater',
- type: 'error',
- position: 'bottom-right'
- });
- } else {
- ElNotification({
- title: 'Linux compatible',
- message: 'No error reported',
- type: 'success',
- position: 'bottom-right'
+ await invoke("linux_checks")
+ .then(() => {
+ ElNotification({
+ title: 'Linux compatible',
+ message: 'All checks passed',
+ type: 'success',
+ position: 'bottom-right'
+ });
+ })
+ .catch((error) => {
+ ElNotification({
+ title: 'Not linux compatible',
+ message: error,
+ type: 'error',
+ position: 'bottom-right'
+ });
+ console.error(error);
});
- }
},
async toggleReleaseCandidate() {
// Flip between RELEASE and RELEASE_CANDIDATE
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() {