Explorar el Código

[FIX] mimetype

Gogs hace 6 años
padre
commit
c70315fd07
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      static/src/js/main.js

+ 2 - 1
static/src/js/main.js

@@ -403,7 +403,7 @@ openerp.printer_bridge = function (instance, local) {
             if (matchMimeType) {
                 if (this.source.startsWith('data:application/pdf;base64,')) {
                     this.source = {
-                        data: this.source
+                        data: this.source.replace(matchMimeType[0], '')
                     };
                 }
             }
@@ -412,6 +412,7 @@ openerp.printer_bridge = function (instance, local) {
                 atob(this.source.data || this.source);
             } catch (e) {
                 instance.webclient.crashmanager.show_message('Unknown data format');
+                return;
             }
 
             var self = this;