47
47
48
48
import { mixins } from " vue-class-component" ;
49
49
import { Component } from ' vue-property-decorator' ;
50
- import { Store } from " vuex" ;
51
50
52
51
import { Progress } from ' ../all' ;
53
52
import ModalCard from ' ../ModalCard.vue' ;
54
53
import DownloadModVersionSelectModal from " ../../components/views/DownloadModVersionSelectModal.vue" ;
55
54
import UpdateAllInstalledModsModal from " ../../components/views/UpdateAllInstalledModsModal.vue" ;
56
55
import DownloadMixin from " ../mixins/DownloadMixin.vue" ;
57
- import { ImmutableProfile } from ' ../../model/Profile' ;
58
56
import R2Error from ' ../../model/errors/R2Error' ;
59
57
import ThunderstoreMod from ' ../../model/ThunderstoreMod' ;
60
58
import ThunderstoreVersion from ' ../../model/ThunderstoreVersion' ;
@@ -71,32 +69,6 @@ import ThunderstoreDownloaderProvider from '../../providers/ror2/downloading/Thu
71
69
})
72
70
export default class DownloadModModal extends mixins (DownloadMixin ) {
73
71
74
- public static async downloadAndInstallSpecific(
75
- profile : ImmutableProfile ,
76
- combo : ThunderstoreCombo ,
77
- store : Store <any >
78
- ): Promise <void > {
79
- const assignId = await store .dispatch (
80
- ' download/addDownload' ,
81
- [` ${combo .getMod ().getName ()} (${combo .getVersion ().getVersionNumber ().toString ()}) ` ]
82
- );
83
-
84
- try {
85
- const downloadedMods = await ThunderstoreDownloaderProvider .instance .download (
86
- profile ,
87
- combo ,
88
- store .state .download .ignoreCache ,
89
- (downloadProgress : number , modName : string , status : number , err : R2Error | null ) => {
90
- store .dispatch (' download/downloadProgressCallback' , { assignId , downloadProgress , modName , status , err });
91
- }
92
- );
93
- await store .dispatch (' download/installMod' , {downloadedMods , assignId , profile });
94
- } catch (e ) {
95
- store .commit (' download/updateDownload' , { assignId , failed: true });
96
- throw e ;
97
- }
98
- }
99
-
100
72
async downloadHandler(tsMod : ThunderstoreMod , tsVersion : ThunderstoreVersion ) {
101
73
this .closeModal ();
102
74
0 commit comments