@trycourier/react-provider 4.2.4-internal.d184663.0 → 4.2.5-internal.5d79641.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ exports.usePageVisible = usePageVisible;
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
|
|
11
11
|
function getIsDocumentHidden() {
|
|
12
|
-
return !document.hidden;
|
|
12
|
+
return typeof document !== "undefined" && !document.hidden;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function usePageVisible(callback) {
|
|
@@ -18,6 +18,10 @@ function usePageVisible(callback) {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
(0, _react.useEffect)(function () {
|
|
21
|
+
if (typeof document === "undefined") {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
document.addEventListener("visibilitychange", onVisibilityChange, false);
|
|
22
26
|
return function () {
|
|
23
27
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/react-provider",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.5-internal.5d79641.0+5d79641",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "typings/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@trycourier/client-graphql": "^4.2.
|
|
19
|
+
"@trycourier/client-graphql": "^4.2.5-internal.5d79641.0+5d79641",
|
|
20
20
|
"buffer": "^6.0.3",
|
|
21
21
|
"jwt-decode": "^3.1.2",
|
|
22
22
|
"react-use": "^17.2.1",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"dist/",
|
|
34
34
|
"typings/"
|
|
35
35
|
],
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "5d79641381933011c6fd6ae6ef71b8ef9915973b"
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-page-visible.d.ts","sourceRoot":"","sources":["../../src/hooks/use-page-visible.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,YAElC;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"use-page-visible.d.ts","sourceRoot":"","sources":["../../src/hooks/use-page-visible.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,YAElC;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,QAepE"}
|