Skip to content

Commit 2d698d6

Browse files
committed
Merge pull-request #1102
2 parents 4fcc1e5 + f22b75f commit 2d698d6

File tree

8 files changed

+296
-154
lines changed

8 files changed

+296
-154
lines changed

.changeset/polite-spies-act.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@turnkey/react-native-wallet-kit": patch
3+
"@turnkey/react-wallet-kit": patch
4+
---
5+
6+
- Added `autoFetchWalletKitConfig` option to the `TurnkeyProvider` config. Setting this to false will disable the initial `walletKitConfig` fetch, saving on initialization time. If this is disabled and you want to use the `handleLogin` modal with Turnkey's Auth Proxy, you must pass in the enabled auth methods manually into the `TurnkeyProvider` config.
7+
8+
- Fixed `refreshWallets` and `refreshUser` not working when `autoRefreshManagedState` is disabled.

examples/react-wallet-kit/src/providers/config/Panel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const omitKeys = [
4545
"createSuborgParams",
4646
"autoRefreshSession",
4747
"oauthConfig",
48+
"autoFetchWalletKitConfig",
49+
"autoRefreshManagedState",
4850
];
4951

5052
interface AuthMethod {

packages/react-native-wallet-kit/src/providers/TurnkeyProvider.tsx

Lines changed: 117 additions & 66 deletions
Large diffs are not rendered by default.

packages/react-native-wallet-kit/src/types/base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ export interface TurnkeyProviderConfig
9292
/** whether to automatically refresh managed state variables */
9393
autoRefreshManagedState?: boolean;
9494

95+
/** whether to automatically fetch the wallet kit config on initialization. */
96+
autoFetchWalletKitConfig?: boolean;
97+
9598
/** default stamper type to use for requests that require stamping. */
9699
defaultStamperType?: StamperType;
97100
}

packages/react-wallet-kit/src/components/auth/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export function AuthComponent({
475475
developerMessages={[
476476
"You are using Turnkey's Auth Proxy, but no auth methods are enabled.",
477477
"To use this modal, you must enable auth methods within the Turnkey dashboard.",
478-
"If you disabled all auth methods within the TurnkeyProvider config, you will also see this error.",
478+
"If you disabled autoFetchWalletKitConfig in the TurnkeyProvider, please ensure that you are passing in the correct auth methods in the TurnkeyProvider's auth config.",
479479
]}
480480
userMessages={["No authentication methods are available."]}
481481
/>

0 commit comments

Comments
 (0)