Skip to content

Commit e5a3d0d

Browse files
Merge pull request #45 from Web3Auth/fix/chain-methods
fix init condition for sfa methods
2 parents de10749 + 6c4d87b commit e5a3d0d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example/react-app/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function shouldSupportPasskey(): { isBrowserSupported: boolean; isOsSuppo
4848
firefox: ">=122",
4949
},
5050
Android: {
51-
chrome: ">=121",
51+
chrome: ">=108",
5252
},
5353
Windows: {
5454
edge: ">=108",

src/Web3Auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,17 @@ class Web3Auth extends SafeEventEmitter implements IWeb3Auth {
205205
}
206206

207207
async addChain(chainConfig: CustomChainConfig): Promise<void> {
208-
if (this.status !== ADAPTER_STATUS.READY) throw WalletInitializationError.notReady("Please call init first.");
208+
if (this.status === ADAPTER_STATUS.NOT_READY) throw WalletInitializationError.notReady("Please call init first.");
209209
return this.privKeyProvider.addChain(chainConfig);
210210
}
211211

212212
switchChain(params: { chainId: string }): Promise<void> {
213-
if (this.status !== ADAPTER_STATUS.READY) throw WalletInitializationError.notReady("Please call init first.");
213+
if (this.status === ADAPTER_STATUS.NOT_READY) throw WalletInitializationError.notReady("Please call init first.");
214214
return this.privKeyProvider.switchChain(params);
215215
}
216216

217217
async getPostboxKey(loginParams: LoginParams): Promise<string> {
218-
if (this.status !== ADAPTER_STATUS.READY) throw WalletInitializationError.notReady("Please call init first.");
218+
if (this.status === ADAPTER_STATUS.NOT_READY) throw WalletInitializationError.notReady("Please call init first.");
219219
return this.getTorusKey(loginParams);
220220
}
221221

0 commit comments

Comments
 (0)