diff --git a/src/components/mixins/DownloadMixin.vue b/src/components/mixins/DownloadMixin.vue index 65a020929..04b7b187d 100644 --- a/src/components/mixins/DownloadMixin.vue +++ b/src/components/mixins/DownloadMixin.vue @@ -2,9 +2,12 @@ import Vue from 'vue'; import Component from 'vue-class-component'; -import ThunderstoreMod from "../../model/ThunderstoreMod"; +import R2Error from "../../model/errors/R2Error"; import Game from "../../model/game/Game"; import Profile from "../../model/Profile"; +import ThunderstoreCombo from "../../model/ThunderstoreCombo"; +import ThunderstoreMod from "../../model/ThunderstoreMod"; +import { installModsAndResolveConflicts } from "../../utils/ProfileUtils"; @Component @@ -29,5 +32,13 @@ export default class DownloadMixin extends Vue { get profile(): Profile { return this.$store.getters['profile/activeProfile']; } + + async downloadCompletedCallback(downloadedMods: ThunderstoreCombo[]): Promise { + try { + await installModsAndResolveConflicts(downloadedMods, this.profile.asImmutableProfile(), this.$store); + } catch (e) { + this.$store.commit('error/handleError', R2Error.fromThrownValue(e)); + } + } } diff --git a/src/components/views/DownloadModModal.vue b/src/components/views/DownloadModModal.vue index eb998f9b1..414b17de7 100644 --- a/src/components/views/DownloadModModal.vue +++ b/src/components/views/DownloadModModal.vue @@ -1,14 +1,14 @@