@ombori/ga-settings
Advanced tools
Comparing version 2.167.1 to 2.169.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.169.0](https://github.com/ombori/gridapp/compare/v2.168.0...v2.169.0) (2022-02-09) | ||
### Features | ||
* ga-settings support on xorg-based screen module ([0ad2fca](https://github.com/ombori/gridapp/commit/0ad2fcaa20cf549196a7d92c10c0b10306ed229c)) | ||
## [2.167.1](https://github.com/ombori/gridapp/compare/v2.167.0...v2.167.1) (2022-02-02) | ||
@@ -8,0 +19,0 @@ |
@@ -99,5 +99,6 @@ "use strict"; | ||
var data = /GridOS\/[0-9.]+ \((.+)\)/.exec(navigator.userAgent); | ||
var userAgentDeviceInfo = {}; | ||
// cog-based screen module | ||
if (data && data[1]) { | ||
var hashParams = getHashParams(); | ||
return data[1] | ||
userAgentDeviceInfo = data[1] | ||
.split('; ') | ||
@@ -109,9 +110,9 @@ .map(function (line) { return line.split('='); }) | ||
return (__assign(__assign({}, res), (_b = {}, _b[name] = val, _b))); | ||
}, | ||
// TODO: expose accessId and accessToken on GridOS through hash | ||
{ | ||
accessId: hashParams.browserId, | ||
accessToken: hashParams.accessKey, | ||
}); | ||
}, {}); | ||
} | ||
// electron-based screen module | ||
var hashParams = getHashParams(); | ||
if (Object.keys(hashParams).length || Object.keys(userAgentDeviceInfo).length) { | ||
return __assign(__assign(__assign({}, userAgentDeviceInfo), hashParams), { accessId: hashParams.browserId, accessToken: hashParams.accessKey }); | ||
} | ||
if (is_dev_1.default) | ||
@@ -118,0 +119,0 @@ return null; |
{ | ||
"name": "@ombori/ga-settings", | ||
"version": "2.167.1", | ||
"version": "2.169.0", | ||
"main": "dist/index.js", | ||
@@ -19,3 +19,3 @@ "license": "UNLICENSED", | ||
}, | ||
"gitHead": "9d574b7fd7146de0e1add87e35b02f20a04c63c0" | ||
"gitHead": "dde0da8404e1b1d7ea11872f2efe9c58f3ca4261" | ||
} |
@@ -167,18 +167,24 @@ import { useEffect, useState, useRef } from 'react'; | ||
const data = /GridOS\/[0-9.]+ \((.+)\)/.exec(navigator.userAgent); | ||
let userAgentDeviceInfo: Partial<DeviceInfo> = {}; | ||
// cog-based screen module | ||
if (data && data[1]) { | ||
const hashParams = getHashParams(); | ||
return data[1] | ||
userAgentDeviceInfo = data[1] | ||
.split('; ') | ||
.map((line) => line.split('=')) | ||
.reduce<DeviceInfo>( | ||
(res, [name, val]) => ({ ...res, [name]: val }), | ||
// TODO: expose accessId and accessToken on GridOS through hash | ||
{ | ||
accessId: hashParams.browserId, | ||
accessToken: hashParams.accessKey, | ||
} as DeviceInfo, | ||
); | ||
.reduce<DeviceInfo>((res, [name, val]) => ({ ...res, [name]: val }), {} as any); | ||
} | ||
// electron-based screen module | ||
const hashParams = getHashParams(); | ||
if (Object.keys(hashParams).length || Object.keys(userAgentDeviceInfo).length) { | ||
return { | ||
...userAgentDeviceInfo, | ||
...hashParams, | ||
accessId: hashParams.browserId, | ||
accessToken: hashParams.accessKey, | ||
} as DeviceInfo; | ||
} | ||
if (isDev) return null; | ||
@@ -185,0 +191,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35138
600