Skip to content

Commit

Permalink
Merge pull request #116 from AElfProject/feature/awaken-access
Browse files Browse the repository at this point in the history
feat: in telegram environment will automatic login, after manually triggering logout
  • Loading branch information
aelf-lxy authored Jul 24, 2024
2 parents fbd5b49 + 7434457 commit 7a58dac
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 8 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.7",
"version": "0.1.3-alpha.8",
"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.7",
"version": "0.1.3-alpha.8",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down
6 changes: 5 additions & 1 deletion packages/bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ class Bridge {
return new Promise((resolve, reject) => {
this._loginResolve = resolve;
this._loginReject = reject;
if (isPortkeyApp()) {
if (TelegramPlatform.isTelegramPlatform()) {
this.autoLogin();
} else if (isPortkeyApp()) {
console.log('begin to execute onUniqueWalletClick in PortkeyApp');
this.onUniqueWalletClick('PortkeyDiscover');
} else {
Expand Down Expand Up @@ -237,6 +239,8 @@ class Bridge {
});
};

autoLogin() {}

openLoginPanel() {}

closeLoginPanel() {}
Expand Down
4 changes: 4 additions & 0 deletions packages/bridge/src/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ const SignInModal: React.FC<ISignInModalProps> = (props: ISignInModalProps) => {
autoAuthInTelegram();
}, [bridgeInstance, handleTelegram]);

bridgeInstance.autoLogin = () => {
handleTelegram();
};

bridgeInstance.openLoginPanel = () => {
setIsShowWrapper(true);
};
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.7",
"version": "0.1.3-alpha.8",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
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.7",
"version": "0.1.3-alpha.8",
"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.7",
"version": "0.1.3-alpha.8",
"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.7",
"version": "0.1.3-alpha.8",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
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.7",
"version": "0.1.3-alpha.8",
"type": "module",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit 7a58dac

Please sign in to comment.