Fix zebra printer library load [SCI-7310] (#4502)

This commit is contained in:
ajugo 2022-10-06 13:52:49 +02:00 committed by GitHub
parent f87b42d042
commit 88d9ece237
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -56,11 +56,8 @@
//= require_directory ./access_permissions //= require_directory ./access_permissions
//= require sidebar //= require sidebar
//= require turbolinks //= require turbolinks
//= require 'BrowserPrint-3.0.216.min'
<% if Rails.configuration.x.zebra_print_enabled %> //= require 'BrowserPrint-Zebra-1.0.216.min'
//= require 'BrowserPrint-3.0.216.min'
//= require 'BrowserPrint-Zebra-1.0.216.min'
<% end %>
// Initialize links for submitting forms. This is useful for submitting // Initialize links for submitting forms. This is useful for submitting
// forms with clicking on links outside form in cases when other than // forms with clicking on links outside form in cases when other than

View file

@ -96,7 +96,7 @@ var zebraPrint = (function() {
try { try {
beforeRefresh(); beforeRefresh();
BrowserPrint.getLocalDevices(function(deviceList) { BrowserPrint.getLocalDevices(function(deviceList) {
if (deviceList.printer && deviceList.printer.length !== 0) { if (deviceList && deviceList.printer && deviceList.printer.length !== 0) {
for (i = 0; i < deviceList.printer.length; i += 1) { for (i = 0; i < deviceList.printer.length; i += 1) {
getPrinterStatus(deviceList.printer[i]).then((device) => { getPrinterStatus(deviceList.printer[i]).then((device) => {
addNewDevice(device, clearSelectorOnFirstDevice); addNewDevice(device, clearSelectorOnFirstDevice);