@rpcbase/client 0.170.0 → 0.172.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.
- package/hashState.js +8 -1
- package/package.json +1 -1
package/hashState.js
CHANGED
|
@@ -12,7 +12,14 @@ const PAGE_NAVIGATION_EVENT = "RB_PAGE_NAVIGATION"
|
|
|
12
12
|
const EMPTY_STATE_TOKEN = "N4XyA" // lz-string encoded empty state ''
|
|
13
13
|
|
|
14
14
|
// WARNING: this assumes hash_str starts with "#"
|
|
15
|
-
const parse_hash_str = (
|
|
15
|
+
const parse_hash_str = (_hash_str) => {
|
|
16
|
+
let hash_str
|
|
17
|
+
if (_hash_str) hash_str = _hash_str
|
|
18
|
+
else if (typeof window !== "undefined" && window?.location?.hash) {
|
|
19
|
+
hash_str = window.location.hash
|
|
20
|
+
} else {
|
|
21
|
+
hash_str = ""
|
|
22
|
+
}
|
|
16
23
|
if (hash_str.length < 1) {
|
|
17
24
|
return {}
|
|
18
25
|
}
|