add confirm prompt to delete file (#243)

This commit is contained in:
Simon Smith 2025-03-10 09:56:57 +00:00 committed by GitHub
parent 536e823243
commit 5c7accae0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -839,7 +839,9 @@ 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 + "?")) {
handleDeleteFile(selectedFile); handleDeleteFile(selectedFile);
}
}} }}
onSelect={() => handleOnSelectFile(file)} onSelect={() => handleOnSelectFile(file)}
onContinueUpload={() => onNewImageClick(file.name)} onContinueUpload={() => onNewImageClick(file.name)}