mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
fix(Dialog): ensure navigation occurs after mount process completion (#273)
This commit is contained in:
@@ -99,9 +99,8 @@ export function Dialog({ onClose }: { onClose: () => void }) {
|
||||
})
|
||||
.finally(() => {
|
||||
setMountInProgress(false);
|
||||
navigate("..");
|
||||
});
|
||||
|
||||
navigate("..");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -125,6 +124,7 @@ export function Dialog({ onClose }: { onClose: () => void }) {
|
||||
// and the modal exit animation for like 500ms
|
||||
setTimeout(() => {
|
||||
setMountInProgress(false);
|
||||
navigate("..");
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
@@ -155,6 +155,7 @@ export function Dialog({ onClose }: { onClose: () => void }) {
|
||||
})
|
||||
.finally(() => {
|
||||
setMountInProgress(false);
|
||||
navigate("..");
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -839,7 +840,11 @@ function DeviceFileView({
|
||||
onDelete={() => {
|
||||
const selectedFile = onStorageFiles.find(f => f.name === file.name);
|
||||
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);
|
||||
}
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user