mirror of
https://github.com/Ellpeck/ObsidianSimpleTimeTracker.git
synced 2024-11-15 23:13:12 +01:00
fixed edited entry names not actually being saved
This commit is contained in:
parent
93440d385a
commit
bce221aaaa
2 changed files with 16 additions and 10 deletions
|
@ -112,17 +112,20 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio
|
|||
.setClass("clickable-icon")
|
||||
.setTooltip("Edit")
|
||||
.setIcon("lucide-pencil")
|
||||
.onClick(() => {
|
||||
.onClick(async () => {
|
||||
if (namePar.hidden) {
|
||||
namePar.hidden = false;
|
||||
nameBox.inputEl.hidden = true;
|
||||
if (nameBox.getValue())
|
||||
namePar.setText(nameBox.getValue());
|
||||
editButton.setIcon("lucide-pencil");
|
||||
if (nameBox.getValue()) {
|
||||
entry.name = nameBox.getValue();
|
||||
namePar.setText(entry.name);
|
||||
await saveTracker(tracker, this.app, getSectionInfo());
|
||||
}
|
||||
} else {
|
||||
namePar.hidden = true;
|
||||
nameBox.inputEl.hidden = false;
|
||||
nameBox.setValue(namePar.getText());
|
||||
nameBox.setValue(entry.name);
|
||||
editButton.setIcon("lucide-check");
|
||||
}
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue