mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-07-13 12:11:17 -03:00
fix(download): close modal before progress overlay and fix downloadId ReferenceError on cancel
This commit is contained in:
@@ -882,13 +882,12 @@ export class DownloadManager {
|
||||
let ws = null;
|
||||
let updateProgress = () => { };
|
||||
let cancelled = false;
|
||||
const downloadId = Date.now().toString();
|
||||
|
||||
try {
|
||||
this.loadingManager.restoreProgressBar();
|
||||
updateProgress = this.loadingManager.showDownloadProgress(1);
|
||||
updateProgress(0, 0, displayName);
|
||||
|
||||
const downloadId = Date.now().toString();
|
||||
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||
ws = new WebSocket(`${wsProtocol}${window.location.host}/ws/download-progress?id=${downloadId}`);
|
||||
|
||||
@@ -1501,6 +1500,8 @@ export class DownloadManager {
|
||||
this.currentVersion?.id, (this.currentVersion?.files || []).length);
|
||||
}
|
||||
|
||||
modalManager.closeModal('downloadModal');
|
||||
|
||||
return this.executeDownloadWithProgress({
|
||||
modelId: this.modelId,
|
||||
versionId: this.currentVersion.id,
|
||||
|
||||
Reference in New Issue
Block a user