mirror of https://github.com/jetkvm/kvm.git
fix(Dialog): ensure navigation occurs after mount process completion (#273)
This commit is contained in:
parent
439ef01687
commit
f30eb0355e
|
@ -99,10 +99,9 @@ export function Dialog({ onClose }: { onClose: () => void }) {
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setMountInProgress(false);
|
setMountInProgress(false);
|
||||||
});
|
|
||||||
|
|
||||||
navigate("..");
|
navigate("..");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleStorageMount(fileName: string, mode: RemoteVirtualMediaState["mode"]) {
|
function handleStorageMount(fileName: string, mode: RemoteVirtualMediaState["mode"]) {
|
||||||
|
@ -125,6 +124,7 @@ export function Dialog({ onClose }: { onClose: () => void }) {
|
||||||
// and the modal exit animation for like 500ms
|
// and the modal exit animation for like 500ms
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setMountInProgress(false);
|
setMountInProgress(false);
|
||||||
|
navigate("..");
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -155,6 +155,7 @@ export function Dialog({ onClose }: { onClose: () => void }) {
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setMountInProgress(false);
|
setMountInProgress(false);
|
||||||
|
navigate("..");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -839,7 +840,11 @@ function DeviceFileView({
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
const selectedFile = onStorageFiles.find(f => f.name === file.name);
|
const selectedFile = onStorageFiles.find(f => f.name === file.name);
|
||||||
if (!selectedFile) return;
|
if (!selectedFile) return;
|
||||||
if (window.confirm("Are you sure you want to delete " + selectedFile.name + "?")) {
|
if (
|
||||||
|
window.confirm(
|
||||||
|
"Are you sure you want to delete " + selectedFile.name + "?",
|
||||||
|
)
|
||||||
|
) {
|
||||||
handleDeleteFile(selectedFile);
|
handleDeleteFile(selectedFile);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in New Issue