@ic-reactor/react 1.14.1 → 1.14.2

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.
@@ -21,7 +21,6 @@ const authHooks = (agentManager) => {
21
21
  const useAuthState = () => (0, zustand_1.useStore)(authStore);
22
22
  const useUserPrincipal = () => { var _a, _b; return (_b = (_a = useAuthState()) === null || _a === void 0 ? void 0 : _a.identity) === null || _b === void 0 ? void 0 : _b.getPrincipal(); };
23
23
  const useAuth = ({ onAuthentication, onAuthenticationSuccess, onAuthenticationFailure, onLogin, onLoginSuccess, onLoginError, onLoggedOut, } = {}) => {
24
- const network = react_1.default.useRef("ic");
25
24
  const [loginState, setLoginState] = react_1.default.useState({
26
25
  loading: false,
27
26
  error: undefined,
@@ -98,17 +97,6 @@ const authHooks = (agentManager) => {
98
97
  yield authenticate();
99
98
  onLoggedOut === null || onLoggedOut === void 0 ? void 0 : onLoggedOut();
100
99
  }), [onLoggedOut]);
101
- react_1.default.useEffect(() => {
102
- const unsubscribe = agentManager.subscribeAgent((agent) => {
103
- const agentNetwork = (0, utils_1.getNetworkByHostname)(agent.host.hostname);
104
- if (network.current !== agentNetwork) {
105
- network.current = agentNetwork;
106
- authenticate();
107
- }
108
- });
109
- authenticate();
110
- return unsubscribe;
111
- }, []);
112
100
  return {
113
101
  authenticated,
114
102
  authenticating,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/react",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "description": "A React library for interacting with Internet Computer canisters",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "node": ">=10"
36
36
  },
37
37
  "dependencies": {
38
- "@ic-reactor/core": "^1.14.0",
38
+ "@ic-reactor/core": "^1.14.1",
39
39
  "zustand": "4.5",
40
40
  "zustand-utils": "^1.3"
41
41
  },
@@ -48,5 +48,12 @@
48
48
  "react": ">=16.8",
49
49
  "zustand": "4.5"
50
50
  },
51
- "gitHead": "fee4b92574ba3fd295e28fb49105f0a07c6fdb61"
51
+ "gitHead": "aea7af668dd77ce24373f4103b6910cfc8cc03de",
52
+ "devDependencies": {
53
+ "@dfinity/agent": ">=2.1",
54
+ "@dfinity/auth-client": ">=2.1",
55
+ "@types/node": "^22.9.0",
56
+ "@types/react": "^18",
57
+ "react": "^18"
58
+ }
52
59
  }