Browse Source

[IMP] web_drop_target: Handle FilerReader error

pull/971/head
Pablo Fuentes 6 years ago
parent
commit
882bf07c3f
  1. 5
      web_drop_target/static/src/js/web_drop_target.js

5
web_drop_target/static/src/js/web_drop_target.js

@ -102,6 +102,10 @@ odoo.define('web_drop_target', function(require) {
});
},
_file_reader_error_handler: function(e){
console.error(e);
},
_handle_file_drop_attach: function(
item, e, res_model, res_id, extra_data
) {
@ -111,6 +115,7 @@ odoo.define('web_drop_target', function(require) {
reader.onloadend = self.proxy(
_.partial(self._create_attachment, file, reader, e, res_model, res_id, extra_data)
);
reader.onerror = self.proxy('_file_reader_error_handler');
reader.readAsArrayBuffer(file);
},

Loading…
Cancel
Save