feat(geomap): dismiss creation if dialog is dismissed

This commit is contained in:
Elian Doran 2025-01-21 20:40:19 +02:00
parent d1aa0e5f50
commit c2cb07ed08
No known key found for this signature in database

View File

@ -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") });
if (!title?.trim()) {
return;
if (title?.trim()) {
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.#adjustCursor();
}