mirror of
https://github.com/Ellpeck/ObsidianSimpleTimeTracker.git
synced 2024-11-22 01:23:28 +01:00
Feature prompt before delete (#48)
* fix: file rename bug * feat: prompt user before deleting
This commit is contained in:
parent
6823de48a0
commit
bf9ac5636c
1 changed files with 3 additions and 0 deletions
|
@ -363,6 +363,9 @@ function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableEle
|
||||||
.setIcon("lucide-trash")
|
.setIcon("lucide-trash")
|
||||||
.setDisabled(entryRunning)
|
.setDisabled(entryRunning)
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
|
if (!confirm("Are you sure you want to delete this entry?")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
removeEntry(tracker.entries, entry);
|
removeEntry(tracker.entries, entry);
|
||||||
await saveTracker(tracker, this.app, getFile(), getSectionInfo());
|
await saveTracker(tracker, this.app, getFile(), getSectionInfo());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue