Skip to content

Commit dbf8634

Browse files
authored
Merge pull request #1678 from ebkr/track-installation-progress-via-link
Add installation tracking to mod installation when it's initiated by a link
2 parents 49df270 + 8cabee6 commit dbf8634

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/components/views/DownloadModModal.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,35 @@ 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 });
113116
return reject(
114117
R2Error.fromThrownValue(e, `Failed to install mod [${combo.getMod().getFullName()}]`)
115118
);
116119
}
120+
store.commit('download/updateDownload', {
121+
assignId,
122+
modName: combo.getMod().getName(),
123+
installProgress: ThunderstoreDownloaderProvider.instance.generateProgressPercentage(100, currentDownloadIndex, downloadedMods.length)
124+
});
125+
currentDownloadIndex++;
117126
}
118127
const modList = await ProfileModList.getModList(profile.asImmutableProfile());
119128
if (modList instanceof R2Error) {
129+
store.commit('download/updateDownload', { assignId, failed: true });
120130
return reject(modList);
121131
}
122132
const err = await ConflictManagementProvider.instance.resolveConflicts(modList, profile.asImmutableProfile());
123133
if (err instanceof R2Error) {
134+
store.commit('download/updateDownload', { assignId, failed: true });
124135
return reject(err);
125136
}
126137
return resolve();

0 commit comments

Comments
 (0)