Properly detect duplicate uploads

This commit is contained in:
Christoph Haas 2021-02-21 11:38:53 +01:00
parent 46352afc58
commit 1a21007068
2 changed files with 34 additions and 24 deletions

View file

@ -105,7 +105,8 @@ function upload_file_with_ajax(file)
error: function(xhr, txt, err)
{
console.log("AJAX file upload returned error: "+txt+" / "+err);
display_error('Did you copy a proper image into your clipboard?');
response = JSON.parse(xhr.responseText);
display_error(response);
},
success: function(res)
{
@ -119,5 +120,5 @@ function upload_file_with_ajax(file)
function display_error(msg)
{
$('#messages').html(
'<div class="callout alert alert-callout-subtle radius">Sorry, pasting did not work.' + msg + '</div>')
'<div class="callout alert alert-callout-subtle radius">Sorry, pasting did not work. ' + msg + '</div>')
}