@one_deploy/sdk 1.0.0 → 1.0.1

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.
@@ -1,4 +1,4 @@
1
- import React2, { createContext, useState, useMemo, useEffect, useCallback, useContext } from 'react';
1
+ import React2, { createContext, useMemo, useState, useCallback, useEffect, useContext } from 'react';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { createThirdwebClient } from 'thirdweb';
4
4
  import { ThirdwebProvider } from 'thirdweb/react';
@@ -1211,16 +1211,15 @@ function OneProvider({
1211
1211
  config: config2,
1212
1212
  autoFetchBalance = true
1213
1213
  }) {
1214
- const [isInitialized, setIsInitialized] = useState(false);
1214
+ useMemo(() => {
1215
+ initOneSDK(config2);
1216
+ }, [config2]);
1217
+ const [isInitialized, setIsInitialized] = useState(true);
1215
1218
  const engine = useMemo(() => createOneEngineClient({
1216
1219
  baseUrl: config2.oneEngineUrl,
1217
1220
  clientId: config2.oneClientId,
1218
1221
  secretKey: config2.oneSecretKey
1219
1222
  }), [config2]);
1220
- useEffect(() => {
1221
- initOneSDK(config2);
1222
- setIsInitialized(true);
1223
- }, [config2]);
1224
1223
  const [user, setUser] = useState(null);
1225
1224
  const [accessToken, setAccessToken] = useState(null);
1226
1225
  const [authLoading, setAuthLoading] = useState(true);