Skip to content

Commit

Permalink
fix: Automatically reconnect after logging out of the app
Browse files Browse the repository at this point in the history
  • Loading branch information
aelf-lxy committed Jul 23, 2024
1 parent 1c935f5 commit ca02523
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/wallet-adapter-base",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/wallet-adapter-bridge",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
7 changes: 6 additions & 1 deletion packages/bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ class Bridge {
return new Promise((resolve, reject) => {
this._loginResolve = resolve;
this._loginReject = reject;
this.openLoginPanel();
if (isPortkeyApp()) {
console.log('begin to execute onUniqueWalletClick in PortkeyApp');
this.onUniqueWalletClick('PortkeyDiscover');
} else {
this.openLoginPanel();
}
});
};

Expand Down
1 change: 1 addition & 0 deletions packages/bridge/src/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
display: flex;
height: 20px;
gap: 12px;
justify-content: flex-end;
}
.crypto-extra-image-arrow {
width: 12px;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/wallet-adapter-react",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/starter/src/Demo/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ const baseConfig = {
// ConfirmLogoutDialog: CustomizedConfirmLogoutDialog,
// SignInComponent: SignInProxy,
PortkeyProviderProps: {
theme: 'dark' as any,
theme: 'light' as any,
},
showVconsole: true,
networkType: NETWORK_TYPE,
chainId: CHAIN_ID,
keyboard: true,
// noCommonBaseModal: true,
noCommonBaseModal: false,
design: SignInDesignEnum.CryptoDesign, // "SocialDesign" | "CryptoDesign" | "Web2Design"
titleForSocialDesign: 'Crypto wallet',
iconSrcForSocialDesign:
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/utils",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/night-elf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/wallet-adapter-night-elf",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/portkey-aa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/wallet-adapter-portkey-aa",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
15 changes: 11 additions & 4 deletions packages/wallets/portkey-aa/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,18 @@ export class PortkeyAAWallet extends BaseWalletAdapter {
}

let nickName = 'Wallet 01';
try {
const holderInfo = await did.getCAHolderInfo(didWalletInfo.chainId);
nickName = holderInfo.nickName;
} catch (error) {
console.log('portkeyAA login and execute did.getCAHolderInfo. nickName:', nickName, error);
}

const holderInfo = await did.getCAHolderInfo(didWalletInfo.chainId);
nickName = holderInfo.nickName;

await did.save(didWalletInfo.pin, this.appName);
try {
await did.save(didWalletInfo.pin, this.appName);
} catch (e) {
console.log('portkeyAA login and execute did.save.', e);
}

const portkeyInfo = {
...didWalletInfo,
Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/portkey-discover/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aelf-web-login/wallet-adapter-portkey-discover",
"version": "0.1.3-alpha.5",
"version": "0.1.3-alpha.7",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit ca02523

Please sign in to comment.