diff --git a/package-lock.json b/package-lock.json index d8802a1..0d8dba0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ulms/api-clients", - "version": "7.12.1", + "version": "7.13.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ulms/api-clients", - "version": "7.12.1", + "version": "7.13.0", "license": "MIT", "dependencies": { "axios": "1.6.2", diff --git a/package.json b/package.json index 4c99b90..f0d8fbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ulms/api-clients", - "version": "7.12.1", + "version": "7.13.0", "description": "JavaScript API clients for ULMS platform", "keywords": [], "homepage": "https://github.com/foxford/ulms-api-clients-js#readme", diff --git a/src/mqtt.js b/src/mqtt.js index a93d15b..0c6f531 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -1,5 +1,5 @@ /* eslint-disable max-classes-per-file */ -/* global mqtt */ +/* global bowser, mqtt */ // using version from cdn // import mqtt from 'mqtt' @@ -39,7 +39,13 @@ class MQTTClient { static async loadDependencies() { const isBigIntSupported = typeof BigInt !== 'undefined' - const mqttVersion = isBigIntSupported ? '5.9.1' : '3.0.0' + const isOldBrowserVersion = bowser + .getParser(window.navigator.userAgent) + .satisfies({ + safari: '<15', + }) + const mqttVersion = + isBigIntSupported && !isOldBrowserVersion ? '5.9.1' : '3.0.0' const source = `https://ulms-static.foxford.ngcdn.ru/prod/js/mqtt@${mqttVersion}/dist/mqtt.min.js` return retry(() => loadScript(source))