Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix upload of the same file in succession, #388
zadam8b250ed523f8
diff --git a/src/public/javascripts/services/export.js b/src/public/javascripts/services/export.jsindex e81ddb6e61..e2b02f6a5b 100644--- a/src/public/javascripts/services/export.js+++ b/src/public/javascripts/services/export.js@@ -23,6 +23,10 @@ $("#import-upload").change(async function() {const formData = new FormData();formData.append('upload', this.files[0]);+ // this is done to reset the field otherwise triggering import same file again would not work+ // https://github.com/zadam/trilium/issues/388+ $("#import-upload").val('');+await $.ajax({url: baseApiUrl + 'notes/' + importNoteId + '/import',headers: server.getHeaders(),diff --git a/src/public/javascripts/services/file.js b/src/public/javascripts/services/file.jsindex 2e473f4e8e..4b2e7c4e78 100644--- a/src/public/javascripts/services/file.js+++ b/src/public/javascripts/services/file.js@@ -10,6 +10,10 @@ $("#file-upload").change(async function() {const formData = new FormData();formData.append('upload', this.files[0]);+ // this is done to reset the field otherwise triggering import same file again would not work+ // https://github.com/zadam/trilium/issues/388+ $("#file-upload").val('');+const resp = await $.ajax({url: baseApiUrl + 'notes/' + noteDetailService.getCurrentNoteId() + '/upload',headers: server.getHeaders(),