fix upload of the same file in succession, #388

This commit is contained in:
zadam 2019-02-03 17:44:06 +01:00
parent d8b78d8025
commit 8b250ed523
2 changed files with 8 additions and 0 deletions

View file

@ -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(),

View file

@ -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(),