From 6f69b1594dc381b421ac048003a38608f0828688 Mon Sep 17 00:00:00 2001 From: Roy <92044428+impelcrypto@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:46:20 +0800 Subject: [PATCH] fix: displays CCIP tooltip only once (#1425) --- src/components/assets/EvmNativeToken.vue | 5 ++++- src/config/localStorage.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/assets/EvmNativeToken.vue b/src/components/assets/EvmNativeToken.vue index c1ae04a08..070c15e66 100644 --- a/src/components/assets/EvmNativeToken.vue +++ b/src/components/assets/EvmNativeToken.vue @@ -166,6 +166,7 @@ import { computed, defineComponent, ref, watch, watchEffect } from 'vue'; import { nativeBridgeEnabled, layerZeroBridgeEnabled, ccipMinatoBridgeEnabled } from 'src/features'; import CustomRouterLink from '../common/CustomRouterLink.vue'; import Balloon from 'src/components/common/Balloon.vue'; +import { LOCAL_STORAGE } from 'src/config/localStorage'; export default defineComponent({ components: { ModalFaucet, CustomRouterLink, Balloon }, @@ -242,9 +243,11 @@ export default defineComponent({ watch( [isShibuyaEvm], async () => { - if (isShibuyaEvm.value) { + const isBallonDisplayed = Boolean(localStorage.getItem(LOCAL_STORAGE.BALLOON_CCIP_SHIBUYA)); + if (isShibuyaEvm.value && !isBallonDisplayed) { await wait(1000); isCcipBalloon.value = true; + localStorage.setItem(LOCAL_STORAGE.BALLOON_CCIP_SHIBUYA, 'true'); } }, { immediate: true } diff --git a/src/config/localStorage.ts b/src/config/localStorage.ts index eb030722f..a6cfcf43c 100644 --- a/src/config/localStorage.ts +++ b/src/config/localStorage.ts @@ -17,6 +17,7 @@ export enum LOCAL_STORAGE { XCM_TX_HISTORIES = 'xcmTxHistories', XVM_TX_HISTORIES = 'xvmTxHistories', BALLOON_NATIVE_TOKEN = 'balloonNativeToken', + BALLOON_CCIP_SHIBUYA = 'balloonCcipShibuya', THEME_COLOR = 'themeColor', MULTISIG = 'multisig', CLOSE_DAPP_STAKING_V3_ONBOARDING = 'closeDappStakingV3Onboarding',