Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add h5 debugger #196

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading