@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.
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/dist/providers/index.js +4 -5
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +5 -6
- package/dist/providers/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/providers/OneProvider.tsx +7 -7
package/package.json
CHANGED
|
@@ -106,19 +106,19 @@ export function OneProvider({
|
|
|
106
106
|
config,
|
|
107
107
|
autoFetchBalance = true,
|
|
108
108
|
}: OneProviderProps) {
|
|
109
|
-
// Initialize SDK
|
|
110
|
-
|
|
109
|
+
// Initialize SDK synchronously before creating engine client
|
|
110
|
+
// This must happen before useMemo so getConfig() works in the constructor
|
|
111
|
+
useMemo(() => {
|
|
112
|
+
initOneSDK(config);
|
|
113
|
+
}, [config]);
|
|
114
|
+
|
|
115
|
+
const [isInitialized, setIsInitialized] = useState(true);
|
|
111
116
|
const engine = useMemo(() => createOneEngineClient({
|
|
112
117
|
baseUrl: config.oneEngineUrl,
|
|
113
118
|
clientId: config.oneClientId,
|
|
114
119
|
secretKey: config.oneSecretKey,
|
|
115
120
|
}), [config]);
|
|
116
121
|
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
initOneSDK(config);
|
|
119
|
-
setIsInitialized(true);
|
|
120
|
-
}, [config]);
|
|
121
|
-
|
|
122
122
|
// ===== Auth State =====
|
|
123
123
|
const [user, setUser] = useState<User | null>(null);
|
|
124
124
|
const [accessToken, setAccessToken] = useState<string | null>(null);
|