@@ -103,24 +103,36 @@ import ProfileModList from '../../r2mm/mods/ProfileModList';
103
103
}
104
104
);
105
105
} catch (e ) {
106
+ store .commit (' download/updateDownload' , { assignId , failed: true });
106
107
return reject (e );
107
108
}
108
109
await ProfileModList .requestLock (async () => {
110
+ let currentDownloadIndex = 0 ;
109
111
for (const combo of downloadedMods ) {
110
112
try {
111
113
await DownloadModModal .installModAfterDownload (profile , combo .getMod (), combo .getVersion ());
112
114
} catch (e ) {
115
+ store .commit (' download/updateDownload' , { assignId , failed: true });
116
+ currentDownloadIndex ++ ;
113
117
return reject (
114
118
R2Error .fromThrownValue (e , ` Failed to install mod [${combo .getMod ().getFullName ()}] ` )
115
119
);
116
120
}
121
+ store .commit (' download/updateDownload' , {
122
+ assignId ,
123
+ modName: combo .getMod ().getName (),
124
+ installProgress: ThunderstoreDownloaderProvider .instance .generateProgressPercentage (100 , currentDownloadIndex , downloadedMods .length )
125
+ });
126
+ currentDownloadIndex ++ ;
117
127
}
118
128
const modList = await ProfileModList .getModList (profile .asImmutableProfile ());
119
129
if (modList instanceof R2Error ) {
130
+ store .commit (' download/updateDownload' , { assignId , failed: true });
120
131
return reject (modList );
121
132
}
122
133
const err = await ConflictManagementProvider .instance .resolveConflicts (modList , profile .asImmutableProfile ());
123
134
if (err instanceof R2Error ) {
135
+ store .commit (' download/updateDownload' , { assignId , failed: true });
124
136
return reject (err );
125
137
}
126
138
return resolve ();
0 commit comments