Skip to content

Commit

Permalink
🔥 Remove eth functions
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 13, 2024
1 parent b71972d commit 9d80cb0
Show file tree
Hide file tree
Showing 36 changed files with 17 additions and 2,318 deletions.
43 changes: 0 additions & 43 deletions components/EthMixin.vue

This file was deleted.

63 changes: 0 additions & 63 deletions components/ViewEtherscan.vue

This file was deleted.

92 changes: 1 addition & 91 deletions components/dialogs/AuthDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,32 +212,6 @@ width: 24px;margin-right: 24px"
@click="onClickUseWalletConnectButton"
>Wallet Connect</button>
</div>
<div
:class="[
'auth-dialog__wallet-panel',
'auth-dialog__wallet-panel--portal',
'auth-dialog__wallet-panel--dashed',
'lc-margin-top-24',
]"
>
<simple-svg
:filepath="MetaMaskLogo"
width="148px"
height="28px"
/>
<a
:class="[
'lc-margin-top-12',
'lc-font-size-12',
'lc-text-align-center',
'lc-color-gray-9b',
'lc-underline',
]"
@click="onClickUseMetaMaskButton"
>
{{ $t('AuthDialog.SignInWithWallet.legacy') }}
</a>
</div>
</div>
</div>

Expand Down Expand Up @@ -367,18 +341,15 @@ import { ResizeObserver } from 'resize-observer';
import URL from 'url-parse';
import { EXTERNAL_URL } from '@/constant';
import { apiCheckIsUser } from '@/util/api/api';
import AuthCoreRegister from '~/components/AuthCore/Register';
import BaseDialogV2 from '~/components/dialogs/BaseDialogV2';
// import EmailSigninForm from './AuthDialogContent/SignInWithEmail';
import RegisterForm from './AuthDialogContent/Register';
import EthMixin from '~/components/EthMixin';
import User from '@/util/User';
import LikeCoinLogo from '~/assets/logo/icon-plain.svg';
import MetaMaskLogo from '~/assets/auth-panel/metamask.svg';
import { logTrackerEvent, logTimingEvent } from '@/util/EventLogger';
import {
Expand Down Expand Up @@ -408,13 +379,9 @@ export default {
AuthCoreRegister,
RegisterForm,
},
mixins: [
EthMixin,
],
data() {
return {
LikeCoinLogo,
MetaMaskLogo,
avatar: undefined,
avatarHalo: 'none',
Expand Down Expand Up @@ -450,8 +417,6 @@ export default {
'getAuthDialogStatus',
'getIsShowAuthDialog',
'getCurrentLocale',
'getMetamaskError',
'getLocalWeb3Wallet',
'getUserMinInfoById',
'getAuthCoreAccessToken',
'getUserIsAuthCore',
Expand All @@ -477,11 +442,8 @@ export default {
isBlocking() {
return this.currentTab === 'loading';
},
shouldHideDialog() {
return !!this.getMetamaskError;
},
shouldShowDialog() {
return this.getIsShowAuthDialog && !this.shouldHideDialog;
return this.getIsShowAuthDialog;
},
isEmailEditable() {
return (
Expand Down Expand Up @@ -657,12 +619,6 @@ export default {
return;
}
// Listen to onClickReturnButton event of MetaMaskDialog
this.$root.$on('MetaMaskDialog.onClickReturnButton', () => {
this.stopWeb3Polling();
this.currentTab = 'portal';
});
// Initialize content height
this.updateContentHeightForCurrentTab();
Expand Down Expand Up @@ -894,9 +850,6 @@ export default {
onClickUseWalletConnectButton() {
this.signInWithPlatform('cosmosWallet', { source: 'walletconnect' });
},
onClickUseMetaMaskButton() {
this.signInWithPlatform('wallet');
},
onClickBackButton() {
switch (this.currentTab) {
case 'portal':
Expand Down Expand Up @@ -1042,11 +995,6 @@ export default {
this.logRegisterEvent(this, 'RegFlow', 'LoginTry', `LoginTry(${platform})`, 1);
switch (platform) {
case 'wallet': {
this.currentTab = 'loading';
this.startWeb3AndCb(this.signInWithWallet);
return;
}
case 'likeWallet':
case 'cosmosWallet': {
this.currentTab = 'loading';
Expand All @@ -1061,44 +1009,6 @@ export default {
}
}
},
async signInWithWallet() {
this.currentTab = 'loading';
// Determine whether the wallet has registered
try {
await apiCheckIsUser(this.getLocalWeb3Wallet);
} catch (err) {
if (err.response) {
if (err.response.status === 404) {
this.setError('WALLET_REGISTER_DEPRECATED', err);
return;
}
}
// eslint-disable-next-line no-console
console.error(err);
this.setError((err.response || {}).data, err);
return;
}
try {
this.signInPayload = await User.signLogin(this.getLocalWeb3Wallet);
this.login();
} catch (err) {
if (err.message.indexOf('Invalid "from" address') >= 0) {
// User has logout MetaMask after EthHelper initialization
this.currentTab = 'loading';
this.startWeb3AndCb(this.signInWithWallet, true);
} else if (err.message.indexOf('User denied message signature') >= 0) {
// Return to login portal if user denied signing
this.currentTab = 'portal';
} else {
// eslint-disable-next-line no-console
console.error(err);
this.setError(err.message, err);
}
}
},
async signInWithCosmosWallet(source = 'keplr') {
this.currentTab = 'loading';
try {
Expand Down
63 changes: 0 additions & 63 deletions components/dialogs/ChromeDialog.vue

This file was deleted.

Loading

0 comments on commit 9d80cb0

Please sign in to comment.