@rpcbase/client 0.40.0 → 0.41.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.
Files changed (2) hide show
  1. package/auth/index.js +3 -3
  2. package/package.json +1 -1
package/auth/index.js CHANGED
@@ -12,7 +12,7 @@ const log = debug("rb:auth")
12
12
  // TODO: this should be refactored to AuthContext + Provider
13
13
 
14
14
  let __is_authenticated = null
15
- let __user_id = localStorage.getItem(UID_STORAGE_KEY)
15
+ let __user_id = localStorage?.getItem(UID_STORAGE_KEY)
16
16
 
17
17
 
18
18
  const run_session_check = async() => {
@@ -26,8 +26,8 @@ const run_session_check = async() => {
26
26
  }
27
27
  }
28
28
 
29
- // Force trigger run first session check
30
- run_session_check()
29
+ // Force trigger run first session check (when we are not in a webworker)
30
+ if (typeof window !== "undefined") run_session_check()
31
31
 
32
32
  // manually run first check
33
33
  // TODO: this should come from localStorage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "scripts": {
5
5
  "test": "echo \"Error: no test specified\" && exit 0"
6
6
  },