mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-07-13 20:21:16 -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 ws = null;
|
||||||
let updateProgress = () => { };
|
let updateProgress = () => { };
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
|
const downloadId = Date.now().toString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.loadingManager.restoreProgressBar();
|
this.loadingManager.restoreProgressBar();
|
||||||
updateProgress = this.loadingManager.showDownloadProgress(1);
|
updateProgress = this.loadingManager.showDownloadProgress(1);
|
||||||
updateProgress(0, 0, displayName);
|
updateProgress(0, 0, displayName);
|
||||||
|
|
||||||
const downloadId = Date.now().toString();
|
|
||||||
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||||
ws = new WebSocket(`${wsProtocol}${window.location.host}/ws/download-progress?id=${downloadId}`);
|
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);
|
this.currentVersion?.id, (this.currentVersion?.files || []).length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modalManager.closeModal('downloadModal');
|
||||||
|
|
||||||
return this.executeDownloadWithProgress({
|
return this.executeDownloadWithProgress({
|
||||||
modelId: this.modelId,
|
modelId: this.modelId,
|
||||||
versionId: this.currentVersion.id,
|
versionId: this.currentVersion.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user