diff --git a/vue-app/src/App.vue b/vue-app/src/App.vue index 332b6715e..c8e06bfeb 100644 --- a/vue-app/src/App.vue +++ b/vue-app/src/App.vue @@ -85,7 +85,7 @@ const routeName = computed(() => route.name?.toString() || '') const isUserAndRoundLoaded = computed(() => !!currentUser.value && !!currentRound.value) const isInApp = computed(() => routeName.value !== 'landing') const isVerifyStep = computed(() => routeName.value === 'verify-step') -const isSideCartShown = computed(() => !!currentUser.value && isSidebarShown.value && routeName.value !== 'cart') +const isSideCartShown = computed(() => isUserAndRoundLoaded.value && isSidebarShown.value && routeName.value !== 'cart') const isCartPadding = computed(() => { const routes = ['cart'] return routes.includes(routeName.value) @@ -169,6 +169,7 @@ onMounted(async () => { await appStore.loadMACIFactoryInfo() await appStore.loadRoundInfo() await recipientStore.loadRecipientRegistryInfo() + appStore.isAppReady = true setupLoadIntervals() }) diff --git a/vue-app/src/components/CallToActionCard.vue b/vue-app/src/components/CallToActionCard.vue index 64f0d8f45..46e3d3512 100644 --- a/vue-app/src/components/CallToActionCard.vue +++ b/vue-app/src/components/CallToActionCard.vue @@ -48,7 +48,7 @@ import { useAppStore, useUserStore } from '@/stores' import { storeToRefs } from 'pinia' const appStore = useAppStore() -const { canUserReallocate, hasContributionPhaseEnded } = storeToRefs(appStore) +const { canUserReallocate, hasContributionPhaseEnded, currentRound } = storeToRefs(appStore) const userStore = useUserStore() const { currentUser } = storeToRefs(userStore) @@ -58,6 +58,7 @@ const hasStartedVerification = computed( const showUserVerification = computed(() => { return ( userRegistryType === UserRegistryType.BRIGHT_ID && + currentRound.value && currentUser.value?.isRegistered !== undefined && !currentUser.value.isRegistered ) diff --git a/vue-app/src/components/Cart.vue b/vue-app/src/components/Cart.vue index bbcd68336..a9d5e2a2a 100644 --- a/vue-app/src/components/Cart.vue +++ b/vue-app/src/components/Cart.vue @@ -1,6 +1,11 @@ diff --git a/vue-app/src/stores/app.ts b/vue-app/src/stores/app.ts index 6e79d4770..7acc3ce28 100644 --- a/vue-app/src/stores/app.ts +++ b/vue-app/src/stores/app.ts @@ -27,6 +27,7 @@ import { assert, ASSERT_MISSING_ROUND, ASSERT_MISSING_SIGNATURE, ASSERT_NOT_CONN import { Keypair } from '@clrfund/maci-utils' export type AppState = { + isAppReady: boolean cart: CartItem[] cartEditModeSelected: boolean committedCart: CartItem[] @@ -46,6 +47,7 @@ export type AppState = { export const useAppStore = defineStore('app', { state: (): AppState => ({ + isAppReady: false, cart: new Array(), cartEditModeSelected: false, committedCart: new Array(), diff --git a/vue-app/src/views/Profile.vue b/vue-app/src/views/Profile.vue index 573437c3b..768352a67 100644 --- a/vue-app/src/views/Profile.vue +++ b/vue-app/src/views/Profile.vue @@ -131,7 +131,7 @@ onMounted(async () => { const walletProvider = computed(() => currentUser.value?.walletProvider) const showBrightIdWidget = computed( - () => userRegistryType === UserRegistryType.BRIGHT_ID && !hasContributionPhaseEnded.value, + () => userRegistryType === UserRegistryType.BRIGHT_ID && currentRound.value && !hasContributionPhaseEnded.value, ) const tokenLogo = computed(() => getTokenLogo(nativeTokenSymbol.value)) const displayAddress = computed(() => { diff --git a/vue-app/src/views/VerifyLanding.vue b/vue-app/src/views/VerifyLanding.vue index 66ecd8b01..d3878e015 100644 --- a/vue-app/src/views/VerifyLanding.vue +++ b/vue-app/src/views/VerifyLanding.vue @@ -94,7 +94,7 @@ onMounted(async () => { }) const isRoundFull = computed(() => isRoundContributorLimitReached.value) -const isRoundOver = computed(() => hasContributionPhaseEnded.value) +const isRoundOver = computed(() => !currentRound.value || hasContributionPhaseEnded.value) const showBrightIdButton = computed(() => currentUser.value?.isRegistered === false) async function promptSignagure() {