diff --git a/src/public/javascripts/desktop.js b/src/public/javascripts/desktop.js index 55bfbadfd..9f3675335 100644 --- a/src/public/javascripts/desktop.js +++ b/src/public/javascripts/desktop.js @@ -195,8 +195,6 @@ if (utils.isElectron()) { items, selectMenuItemHandler: ({command, spellingSuggestion}) => { if (command === 'replaceMisspelling') { - console.log("Replacing missspeling", spellingSuggestion); - webContents.insertText(spellingSuggestion); } } diff --git a/src/public/javascripts/dialogs/add_link.js b/src/public/javascripts/dialogs/add_link.js index c0e70f091..fc2a03905 100644 --- a/src/public/javascripts/dialogs/add_link.js +++ b/src/public/javascripts/dialogs/add_link.js @@ -48,7 +48,9 @@ export async function showDialog(widget) { $autoComplete.on('autocomplete:cursorchanged', function(event, suggestion, dataset) { const noteId = treeService.getNoteIdFromNotePath(suggestion.path); - setDefaultLinkTitle(noteId); + if (noteId) { + setDefaultLinkTitle(noteId); + } }); noteAutocompleteService.showRecentNotes($autoComplete); diff --git a/src/public/javascripts/dialogs/options/credentials.js b/src/public/javascripts/dialogs/options/credentials.js index 63bbeae10..f32c4b390 100644 --- a/src/public/javascripts/dialogs/options/credentials.js +++ b/src/public/javascripts/dialogs/options/credentials.js @@ -40,7 +40,7 @@ export default class ChangePasswordOptions { this.$form.on('submit', () => this.save()); } - optionsLoaded(options) {console.log(options); + optionsLoaded(options) { this.$username.text(options.username); } diff --git a/src/public/javascripts/widgets/type_widgets/book.js b/src/public/javascripts/widgets/type_widgets/book.js index b8ccd5010..260c180a9 100644 --- a/src/public/javascripts/widgets/type_widgets/book.js +++ b/src/public/javascripts/widgets/type_widgets/book.js @@ -140,7 +140,7 @@ export default class BookTypeWidget extends TypeWidget { }); this.$content.append($('
') - .append(`This note doesn't have any content so we display its children. Click `) + .append(`This note doesn't have any content so we display its children.
Click `) .append($addTextLink) .append(' if you want to add some text.')); } diff --git a/src/public/javascripts/widgets/type_widgets/relation_map.js b/src/public/javascripts/widgets/type_widgets/relation_map.js index f54504f74..e87ae63fd 100644 --- a/src/public/javascripts/widgets/type_widgets/relation_map.js +++ b/src/public/javascripts/widgets/type_widgets/relation_map.js @@ -7,6 +7,7 @@ import toastService from "../../services/toast.js"; import attributeAutocompleteService from "../../services/attribute_autocomplete.js"; import TypeWidget from "./type_widget.js"; import appContext from "../../services/app_context.js"; +import utils from "../../services/utils.js"; const uniDirectionalOverlays = [ [ "Arrow", { @@ -165,10 +166,6 @@ export default class RelationMapTypeWidget extends TypeWidget { toastService.showMessage("Click on canvas to place new note"); - // reloading tree so that the new note appears there - // no need to wait for it to finish - treeService.reload(); - this.clipboard = { noteId: note.noteId, title }; }); @@ -208,10 +205,9 @@ export default class RelationMapTypeWidget extends TypeWidget { this.jsPlumbInstance.remove(this.noteIdToId(noteId)); if (confirmDialog.isDeleteNoteChecked()) { - await server.remove("notes/" + noteId); + const taskId = utils.randomString(10); - // to force it to disappear from the tree - treeService.reload(); + await server.remove(`notes/${noteId}?taskId=${taskId}&last=true`); } this.mapData.notes = this.mapData.notes.filter(note => note.noteId !== noteId);