Skip to content

Commit

Permalink
Simplify conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Nov 5, 2024
1 parent 6b56b86 commit a153969
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions js/qz-tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,15 +963,13 @@ var qz = (function() {
/** Check if QZ version supports chosen algorithm */
algorithm: function(quiet) {
//if not connected yet we will assume compatibility exists for the time being
if (_qz.tools.isActive()) {
//guard race condition for pending connections
if( _qz.websocket.connection && _qz.websocket.connection.semver) {
if (_qz.tools.isVersion(2, 0)) {
if (!quiet) {
_qz.log.warn("Connected to an older version of QZ, alternate signature algorithms are not supported");
}
return false;
//check semver to guard race condition for pending connections
if (_qz.tools.isActive() && _qz.websocket.connection.semver) {
if (_qz.tools.isVersion(2, 0)) {
if (!quiet) {
_qz.log.warn("Connected to an older version of QZ, alternate signature algorithms are not supported");
}
return false;
}
}

Expand Down

0 comments on commit a153969

Please sign in to comment.