Skip to content

Commit 78eca50

Browse files
authored
Update interface.html to add confirmation before track delete
Instead of showing another popup for track delete confirmation, it now simply changes the button text to “Confirm Delete” for 3 seconds and a second tap will actually perform the delete.
1 parent ae661f3 commit 78eca50

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

apps/recorder/interface.html

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -829,11 +829,29 @@ <h2>Settings</h2>
829829

830830
switch(task) {
831831
case "delete":
832-
Util.showModal(`Deleting ${filename}...`);
833-
Util.eraseStorageFile(filename, () => {
834-
Util.hideModal();
835-
getTrackList();
836-
});
832+
if (button.dataset.confirmDelete === "true") {
833+
// Second click - proceed with deletion
834+
Util.showModal(`Deleting ${filename}...`);
835+
Util.eraseStorageFile(filename, () => {
836+
Util.hideModal();
837+
getTrackList();
838+
});
839+
} else {
840+
// First click - change to confirm state
841+
const originalText = button.textContent;
842+
button.textContent = "Confirm Delete";
843+
button.classList.add("btn-error");
844+
button.dataset.confirmDelete = "true";
845+
846+
// Reset after 3 seconds
847+
setTimeout(() => {
848+
if (button.dataset.confirmDelete === "true") {
849+
button.textContent = originalText;
850+
button.classList.remove("btn-error");
851+
delete button.dataset.confirmDelete;
852+
}
853+
}, 3000);
854+
}
837855
break;
838856
case "downloadkml":
839857
downloadTrack(filename, track => saveKML(track, `Bangle.js Track ${trackid}`));

0 commit comments

Comments
 (0)