@dubsdotapp/expo 0.2.26 → 0.2.27
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 +18 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/wallet/mwa-adapter.ts +16 -3
package/dist/index.js
CHANGED
|
@@ -599,10 +599,24 @@ var MwaWalletAdapter = class {
|
|
|
599
599
|
*/
|
|
600
600
|
async connect() {
|
|
601
601
|
await this.transact(async (wallet) => {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
602
|
+
let authResult;
|
|
603
|
+
if (this._authToken) {
|
|
604
|
+
try {
|
|
605
|
+
authResult = await wallet.reauthorize({ auth_token: this._authToken });
|
|
606
|
+
} catch {
|
|
607
|
+
console.log("[Dubs:MWA] reauthorize failed, falling back to authorize");
|
|
608
|
+
this._authToken = null;
|
|
609
|
+
authResult = await wallet.authorize({
|
|
610
|
+
identity: this.config.appIdentity,
|
|
611
|
+
cluster: this.config.cluster || "mainnet-beta"
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
} else {
|
|
615
|
+
authResult = await wallet.authorize({
|
|
616
|
+
identity: this.config.appIdentity,
|
|
617
|
+
cluster: this.config.cluster || "mainnet-beta"
|
|
618
|
+
});
|
|
619
|
+
}
|
|
606
620
|
this._mwaAddress = authResult.accounts[0].address;
|
|
607
621
|
this._publicKey = toPublicKey(this._mwaAddress);
|
|
608
622
|
this._authToken = authResult.auth_token;
|