diff options
Diffstat (limited to 'src-vue/src/views/ModsView.vue')
-rw-r--r-- | src-vue/src/views/ModsView.vue | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src-vue/src/views/ModsView.vue b/src-vue/src/views/ModsView.vue index 48e9fbee..3c2b3cfe 100644 --- a/src-vue/src/views/ModsView.vue +++ b/src-vue/src/views/ModsView.vue @@ -3,7 +3,7 @@ <el-scrollbar> <h3>Installed Mods:</h3> <div> - <el-card shadow="hover" v-for="mod in installed_mods"> + <el-card shadow="hover" v-for="mod in $store.state.installed_mods"> <el-switch style="--el-switch-on-color: #13ce66; --el-switch-off-color: #8957e5" v-model="mod.enabled" :before-change="() => updateWhichModsEnabled(mod)" :loading="global_load_indicator" /> {{mod.name}} @@ -24,29 +24,11 @@ export default defineComponent({ name: "ModsView", data() { return { - installed_mods: [] as NorthstarMod[], global_load_indicator: false } }, async mounted() { - let game_install = { - game_path: this.$store.state.game_path, - install_type: this.$store.state.install_type - } as GameInstall; - // Call back-end for installed mods - await invoke("get_installed_mods_caller", { gameInstall: game_install }) - .then((message) => { - this.installed_mods = (message as NorthstarMod[]); - }) - .catch((error) => { - console.error(error); - ElNotification({ - title: 'Error', - message: error, - type: 'error', - position: 'bottom-right' - }); - }); + this.$store.commit('loadInstalledMods'); }, methods: { async updateWhichModsEnabled(mod: NorthstarMod) { |