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 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 (!t) throw Error("Token undefined");
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 (!t) throw Error("Token undefined");
32089
- return t;
32088
+ if (t) return t;
32090
32089
  }
32091
32090
  return "";
32092
32091
  }, [typeof window]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 (!t) throw Error("Token undefined");
8
-
9
- return t;
7
+ if (t) return t;
10
8
  }
11
9
  return "";
12
10
  }, [typeof window]);