Commit 14ab6ac3 authored by mercury233's avatar mercury233

update verify progress tip

parent fe1f5b74
......@@ -28,6 +28,8 @@
<span i18n *ngIf="currentApp.isUninstalling()">正在卸载...</span>
<span i18n *ngIf="currentApp.isWaiting()">等待安装...</span>
<span i18n *ngIf="currentApp.isUpdating()">正在更新...</span>
<span i18n *ngIf="currentApp.isGettingFileList()">正在获取文件列表...</span>
<span i18n *ngIf="currentApp.isVerifying()">正在校验...</span>
<span *ngIf="currentApp.status.total">{{(currentApp.status.progress/currentApp.status.total * 100).toFixed()}}%</span>
<span>{{currentApp.progressMessage()}}</span>
</div>
......
......@@ -188,6 +188,14 @@ export class App {
return this.status.status === 'updating';
}
isGettingFileList(): boolean {
return this.status.status === 'gettingFileList';
}
isVerifying(): boolean {
return this.status.status === 'verifying';
}
runnable(): boolean {
return [Category.game].includes(this.category);
}
......
......@@ -501,12 +501,13 @@ export class AppsService {
readyToUpdate = app.isReady() && mods.every((mod) => mod.isReady());
}
if (readyToUpdate && (verify || app.local!.version !== app.version)) {
app.status.status = 'updating';
app.status.status = 'gettingFileList';
try {
Logger.info('Checking updating: ', app);
let latestFiles = await this.getChecksumFile(app);
let localFiles: Map<string, string> | undefined;
if (verify) {
app.status.status = 'verifying';
// 刷新进度条
let interval = setInterval(() => {
}, 500);
......@@ -527,6 +528,7 @@ export class AppsService {
} else {
localFiles = app.local!.files;
}
app.status.status = 'updating';
let addedFiles: Set<string> = new Set<string>();
let changedFiles: Set<string> = new Set<string>();
let deletedFiles: Set<string> = new Set<string>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment