Skip to content

Commit 4dee400

Browse files
Add installation tracking to mod installation when it's initiated by a link
1 parent 49df270 commit 4dee400

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/components/views/DownloadModModal.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,36 @@ import ProfileModList from '../../r2mm/mods/ProfileModList';
103103
}
104104
);
105105
} catch (e) {
106+
store.commit('download/updateDownload', { assignId, failed: true });
106107
return reject(e);
107108
}
108109
await ProfileModList.requestLock(async () => {
110+
let currentDownloadIndex = 0;
109111
for (const combo of downloadedMods) {
110112
try {
111113
await DownloadModModal.installModAfterDownload(profile, combo.getMod(), combo.getVersion());
112114
} catch (e) {
115+
store.commit('download/updateDownload', { assignId, failed: true });
116+
currentDownloadIndex++;
113117
return reject(
114118
R2Error.fromThrownValue(e, `Failed to install mod [${combo.getMod().getFullName()}]`)
115119
);
116120
}
121+
store.commit('download/updateDownload', {
122+
assignId,
123+
modName: combo.getMod().getName(),
124+
installProgress: ThunderstoreDownloaderProvider.instance.generateProgressPercentage(100, currentDownloadIndex, downloadedMods.length)
125+
});
126+
currentDownloadIndex++;
117127
}
118128
const modList = await ProfileModList.getModList(profile.asImmutableProfile());
119129
if (modList instanceof R2Error) {
130+
store.commit('download/updateDownload', { assignId, failed: true });
120131
return reject(modList);
121132
}
122133
const err = await ConflictManagementProvider.instance.resolveConflicts(modList, profile.asImmutableProfile());
123134
if (err instanceof R2Error) {
135+
store.commit('download/updateDownload', { assignId, failed: true });
124136
return reject(err);
125137
}
126138
return resolve();

0 commit comments

Comments
 (0)