Skip to content

Commit

Permalink
add h5 debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
MickWang committed Apr 25, 2024
1 parent eb408f6 commit 61e23de
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
10 changes: 6 additions & 4 deletions components/transaction/EthereumTransactionFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
</slot>
</CommonButton>
<template v-if="connectorName === 'WalletConnect'">
<CommonButtonUnderlineText :opened="!!walletName?.includes('Binance')">If you're using the Binance Web3 Wallet, please update it to the newest version.</CommonButtonUnderlineText>
<CommonButtonUnderlineText :opened="!!walletName?.includes('Binance')"
>If you're using the Binance Web3 Wallet, please update it to the newest version.</CommonButtonUnderlineText
>
</template>
</template>
<template v-else>
Expand Down Expand Up @@ -126,8 +128,8 @@ const getNetworkInfo = () => {
return props.transaction ? newNetwork ?? primaryNetwork : obj;
} else {
let obj = zkSyncNetworks.find(
(item) => item.key && item.key.toLowerCase() === (props.transaction?.token?.networkKey || 'primary').toLowerCase()
)
(item) => item.key && item.key.toLowerCase() === (props.transaction?.token?.networkKey || "primary").toLowerCase()
);
const objs = { l1Network: { id: l1Network.value?.id } };
return props.transaction ? obj ?? primaryNetwork : objs;
}
Expand All @@ -146,7 +148,7 @@ const isGateWalletUnsupportedChain = computed(() => {
const buttonStep = computed(() => {
console.log("buttonStep getNetworkInfo().l1Network?.id", getNetworkInfo().l1Network?.id);
console.log("buttonStep network.value.chain?.id", network.value.chain?.id);
if (!account.value.address || isConnectingWallet.value) {
if (!account.value.address) {
return "connect";
} else if (!(network.value.chain?.id === getNetworkInfo().l1Network?.id)) {
return "network";
Expand Down
9 changes: 6 additions & 3 deletions components/transaction/TransactionFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<CommonButton
v-if="
connectorName !== 'WalletConnect' ||
(connectorName === 'WalletConnect' && (walletName?.includes('OKX') || walletName?.includes('MetaMask') || walletName?.includes('Binance')))
(connectorName === 'WalletConnect' &&
(walletName?.includes('OKX') || walletName?.includes('MetaMask') || walletName?.includes('Binance')))
"
type="submit"
:disabled="switchingNetworkInProgress"
Expand All @@ -35,7 +36,9 @@
Change network manually to {{ eraNetwork.name }} in your {{ walletName }} wallet
</CommonButton>
<template v-if="connectorName === 'WalletConnect'">
<CommonButtonUnderlineText :opened="!!walletName?.includes('Binance')">If you're using the Binance Web3 Wallet, please update it to the newest version.</CommonButtonUnderlineText>
<CommonButtonUnderlineText :opened="!!walletName?.includes('Binance')"
>If you're using the Binance Web3 Wallet, please update it to the newest version.</CommonButtonUnderlineText
>
</template>

<CommonButton v-else-if="walletName === 'Binance Web3'" disabled variant="primary" class="w-full">
Expand Down Expand Up @@ -68,7 +71,7 @@ const { isCorrectNetworkSet, switchingNetworkInProgress, switchingNetworkError }
const { eraNetwork } = storeToRefs(useZkSyncProviderStore());
const buttonStep = computed(() => {
if (!account.value.address || isConnectingWallet.value) {
if (!account.value.address) {
return "connect";
} else if (!isCorrectNetworkSet.value) {
return "network";
Expand Down
9 changes: 8 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
</div>
</template>

<script lang="ts" setup></script>
<script lang="ts" setup>
import { onBeforeMount } from "vue";
onBeforeMount(() => {
if (window.innerWidth < 500) {
window.eruda.init();
}
});
</script>

<style lang="scss" scoped>
.app-layout {
Expand Down
3 changes: 3 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export default defineNuxtConfig({
src: "https://cdn.rudderlabs.com/v1.1/rudder-analytics.min.js",
defer: true,
},
{
src: '//cdn.jsdelivr.net/npm/eruda'
}
],
},
},
Expand Down
8 changes: 7 additions & 1 deletion store/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,13 @@ export const useOnboardStore = defineStore("onboard", () => {
isConnected: computed(() => !!account.value.address),
network: computed(() => network.value),
isConnectingWallet: computed(() => {
console.log("account.value", account.value.isConnecting, account.value.isReconnecting);
console.log(
"account.value",
account.value.address,
account.value.open,
account.value.isConnecting,
account.value.isReconnecting
);
return account.value.isReconnecting || account.value.isConnecting;
}),
connectingWalletError,
Expand Down

0 comments on commit 61e23de

Please sign in to comment.