next-recomponents 1.1.5 → 1.1.6
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/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +1 -1
- package/src/use-resources/get.token.tsx +1 -3
package/dist/index.js
CHANGED
|
@@ -32094,8 +32094,7 @@ function useToken() {
|
|
|
32094
32094
|
const token = (0, import_react27.useMemo)(() => {
|
|
32095
32095
|
if (typeof window != "undefined") {
|
|
32096
32096
|
const t = window.localStorage.getItem("token");
|
|
32097
|
-
if (
|
|
32098
|
-
return t;
|
|
32097
|
+
if (t) return t;
|
|
32099
32098
|
}
|
|
32100
32099
|
return "";
|
|
32101
32100
|
}, [typeof window]);
|
package/dist/index.mjs
CHANGED
|
@@ -32085,8 +32085,7 @@ function useToken() {
|
|
|
32085
32085
|
const token = useMemo8(() => {
|
|
32086
32086
|
if (typeof window != "undefined") {
|
|
32087
32087
|
const t = window.localStorage.getItem("token");
|
|
32088
|
-
if (
|
|
32089
|
-
return t;
|
|
32088
|
+
if (t) return t;
|
|
32090
32089
|
}
|
|
32091
32090
|
return "";
|
|
32092
32091
|
}, [typeof window]);
|
package/package.json
CHANGED
|
@@ -4,9 +4,7 @@ export default function useToken(): string {
|
|
|
4
4
|
const token = useMemo(() => {
|
|
5
5
|
if (typeof window != "undefined") {
|
|
6
6
|
const t = window.localStorage.getItem("token");
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
return t;
|
|
7
|
+
if (t) return t;
|
|
10
8
|
}
|
|
11
9
|
return "";
|
|
12
10
|
}, [typeof window]);
|