mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 11:02:27 +08:00
feat(geomap): dismiss creation if dialog is dismissed
This commit is contained in:
parent
d1aa0e5f50
commit
c2cb07ed08
@ -213,18 +213,16 @@ export default class GeoMapTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
const title = await dialogService.prompt({ message: t("relation_map.enter_title_of_new_note"), defaultValue: t("relation_map.default_new_note_title") });
|
const title = await dialogService.prompt({ message: t("relation_map.enter_title_of_new_note"), defaultValue: t("relation_map.default_new_note_title") });
|
||||||
|
|
||||||
if (!title?.trim()) {
|
if (title?.trim()) {
|
||||||
return;
|
const { note } = await server.post<CreateChildResponse>(`notes/${this.noteId}/children?target=into`, {
|
||||||
|
title,
|
||||||
|
content: "",
|
||||||
|
type: "text"
|
||||||
|
});
|
||||||
|
attributes.setLabel(note.noteId, "iconClass", CHILD_NOTE_ICON);
|
||||||
|
this.moveMarker(note.noteId, e.latlng);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { note } = await server.post<CreateChildResponse>(`notes/${this.noteId}/children?target=into`, {
|
|
||||||
title,
|
|
||||||
content: "",
|
|
||||||
type: "text"
|
|
||||||
});
|
|
||||||
attributes.setLabel(note.noteId, "iconClass", CHILD_NOTE_ICON);
|
|
||||||
this.moveMarker(note.noteId, e.latlng);
|
|
||||||
|
|
||||||
this.state = State.Normal;
|
this.state = State.Normal;
|
||||||
this.#adjustCursor();
|
this.#adjustCursor();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user