aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/SettingsView.vue
diff options
context:
space:
mode:
authorJan <sentrycraft123@gmail.com>2023-10-06 15:23:31 +0200
committerGitHub <noreply@github.com>2023-10-06 15:23:31 +0200
commited888c8fd4c89df949899a3c0f1be1946ca0523a (patch)
treef1156464eaabaeda9cadbcdc60b315b575c6f8ed /src-vue/src/views/SettingsView.vue
parentca6c9c3e9965105624b1cc0a211b6edf986260f8 (diff)
downloadFlightCore-ed888c8fd4c89df949899a3c0f1be1946ca0523a.tar.gz
FlightCore-ed888c8fd4c89df949899a3c0f1be1946ca0523a.zip
fix: Only fetch profiles if a game path is available (#500)
Diffstat (limited to 'src-vue/src/views/SettingsView.vue')
-rw-r--r--src-vue/src/views/SettingsView.vue18
1 files changed, 15 insertions, 3 deletions
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index b1a62c56..88a5d588 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -34,9 +34,9 @@
<!-- Northstar Active Profile -->
<div class="fc_parameter__panel" v-if="$store.state.developer_mode">
<h3>{{ $t('settings.profile.active') }}</h3>
- <el-dropdown trigger="click">
+ <el-dropdown trigger="click" :disabled="!availableProfiles.length">
<el-button>
- {{ $store.state.game_install.profile }} <el-icon class="el-icon--right"><arrow-down /></el-icon>
+ {{ activeProfile }} <el-icon class="el-icon--right" v-if="availableProfiles.length"><arrow-down /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
@@ -173,7 +173,10 @@ export default defineComponent({
await persistentStore.save(); // explicit save to disk
}
},
- availableProfiles(): Object {
+ activeProfile(): String {
+ return this.$store.state.game_install.profile || "None";
+ },
+ availableProfiles(): Object[] {
let profiles = this.$store.state.available_profiles
// convert string array to object array so we can fill a table
@@ -209,6 +212,15 @@ export default defineComponent({
});
},
async openGameInstallFolder() {
+ // Verify the game path is actually set
+ if (!this.$store.state.game_install.game_path) {
+ showErrorNotification(
+ i18n.global.tc('notification.game_folder.not_found.text'),
+ i18n.global.tc('notification.game_folder.not_found.title')
+ );
+ return;
+ }
+
// Opens the folder in default file explorer application
await open(`${this.$store.state.game_install.game_path}`);
},