diff --git a/vue-app/src/App.vue b/vue-app/src/App.vue
index 3c7ad9b98..01f555ac1 100644
--- a/vue-app/src/App.vue
+++ b/vue-app/src/App.vue
@@ -8,8 +8,20 @@
-
-
+
+
+
+
+
+
+
@@ -20,22 +32,29 @@
diff --git a/vue-app/src/graphql/sdk.ts b/vue-app/src/graphql/sdk.ts
index fc22db618..aea01c2b7 100644
--- a/vue-app/src/graphql/sdk.ts
+++ b/vue-app/src/graphql/sdk.ts
@@ -4,4 +4,9 @@ import { SUBGRAPH_ENDPOINT } from '@/api/core'
import { getSdk } from './API'
const client = new GraphQLClient(SUBGRAPH_ENDPOINT)
-export default getSdk(client)
+
+function getQuerySdk() {
+ return SUBGRAPH_ENDPOINT ? getSdk(client) : {}
+}
+
+export default getQuerySdk()
diff --git a/vue-app/src/router/index.ts b/vue-app/src/router/index.ts
index 86a75d5b9..e6e415a07 100644
--- a/vue-app/src/router/index.ts
+++ b/vue-app/src/router/index.ts
@@ -1,6 +1,6 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
-import { isUserRegistrationRequired, isOptimisticRecipientRegistry, isActiveApp } from '@/api/core'
+import { isUserRegistrationRequired, isOptimisticRecipientRegistry } from '@/api/core'
const Landing = () => import('@/views/Landing.vue')
const JoinLanding = () => import('@/views/JoinLanding.vue')
@@ -262,7 +262,7 @@ if (isUserRegistrationRequired) {
)
}
-if (isOptimisticRecipientRegistry && isActiveApp) {
+if (isOptimisticRecipientRegistry) {
routes.push({
path: '/recipients',
name: 'recipients',
diff --git a/vue-app/src/stores/app.ts b/vue-app/src/stores/app.ts
index 65b7fc494..ad873972d 100644
--- a/vue-app/src/stores/app.ts
+++ b/vue-app/src/stores/app.ts
@@ -9,8 +9,8 @@ import {
serializeCart,
} from '@/api/contributions'
import { getCommittedCart } from '@/api/cart'
-import { operator, chain, ThemeMode, recipientRegistryType, recipientJoinDeadlineConfig, isActiveApp } from '@/api/core'
-import { type RoundInfo, RoundStatus, getRoundInfo, getLeaderboardRoundInfo } from '@/api/round'
+import { operator, chain, ThemeMode, recipientRegistryType, recipientJoinDeadlineConfig } from '@/api/core'
+import { type RoundInfo, RoundStatus, getRoundInfo, getStaticRoundInfo } from '@/api/round'
import { getTally, type Tally } from '@/api/tally'
import { type ClrFund, getClrFundInfo, getMatchingFunds } from '@/api/clrFund'
import { getMACIFactoryInfo, type MACIFactory } from '@/api/maci-factory'
@@ -70,11 +70,6 @@ export const useAppStore = defineStore('app', {
return recipientJoinDeadlineConfig
}
- if (!isActiveApp) {
- // when running in static mode, do not allow adding recipients
- return DateTime.now()
- }
-
const recipientStore = useRecipientStore()
if (!state.currentRound || !recipientStore.recipientRegistryInfo) {
return null
@@ -470,38 +465,6 @@ export const useAppStore = defineStore('app', {
stateIndex,
}
},
- async loadStaticClrFundInfo() {
- const rounds = await getRounds()
- // rounds are sorted in reverse order, first one is the newest round
- const currentRound = rounds[0]
-
- let maxRecipients = 0
- if (currentRound) {
- const network = currentRound.network || ''
- const currentRoundInfo = await getLeaderboardRoundInfo(currentRound.address, network)
- if (currentRoundInfo) {
- const matchingPool = await getMatchingFunds(currentRoundInfo.nativeTokenAddress)
- this.clrFund = {
- nativeTokenAddress: currentRoundInfo.nativeTokenAddress,
- nativeTokenSymbol: currentRoundInfo.nativeTokenSymbol,
- nativeTokenDecimals: currentRoundInfo.nativeTokenDecimals,
- userRegistryAddress: currentRoundInfo.userRegistryAddress,
- recipientRegistryAddress: currentRoundInfo.recipientRegistryAddress,
- matchingPool,
- }
- this.selectRound(currentRound.address)
- this.currentRound = currentRoundInfo
- if (currentRoundInfo.tally) {
- this.tally = currentRoundInfo.tally
- }
- maxRecipients = currentRoundInfo.maxRecipients
- }
- }
- if (!this.clrFund) {
- this.clrFund = await getClrFundInfo()
- }
- await this.loadMACIFactoryInfo(maxRecipients)
- },
async loadClrFundInfo() {
const clrFund = await getClrFundInfo()
this.clrFund = clrFund
diff --git a/vue-app/src/views/Leaderboard.vue b/vue-app/src/views/Leaderboard.vue
index f2e306546..03db7c637 100644
--- a/vue-app/src/views/Leaderboard.vue
+++ b/vue-app/src/views/Leaderboard.vue
@@ -79,7 +79,7 @@ onMounted(async () => {
// redirect to projects view if no tally data or no static round data for leaderboard
if (!data?.projects || !data?.tally) {
- router.push({ name: 'round' })
+ router.push({ name: 'round', params: { address } })
return
}
@@ -98,7 +98,7 @@ onMounted(async () => {
}
try {
- round.value = toRoundInfo(data.round, network)
+ round.value = toRoundInfo(data.round)
} catch (e) {
console.log('Error converting to round info', e)
}
diff --git a/vue-app/src/views/Profile.vue b/vue-app/src/views/Profile.vue
index b4c6612e9..71a74ee7e 100644
--- a/vue-app/src/views/Profile.vue
+++ b/vue-app/src/views/Profile.vue
@@ -103,19 +103,18 @@ import CopyButton from '@/components/CopyButton.vue'
import Loader from '@/components/Loader.vue'
import FundsNeededWarning from '@/components/FundsNeededWarning.vue'
-import { userRegistryType, UserRegistryType, chain, isActiveApp } from '@/api/core'
+import { userRegistryType, UserRegistryType, chain } from '@/api/core'
import { type Project, getProjects, getProjectsForStaticRound } from '@/api/projects'
import { isSameAddress } from '@/utils/accounts'
import { getTokenLogo } from '@/utils/tokens'
import { useAppStore, useUserStore, useRecipientStore, useWalletStore } from '@/stores'
import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router'
-import { getLeaderboardData } from '@/api/leaderboard'
import { formatAmount } from '@/utils/amounts'
import WithdrawalModal from '@/components/WithdrawalModal.vue'
import { useModal } from 'vue-final-modal'
-import { RoundStatus } from '@/api/round'
+import { RoundStatus, getRoundInfo } from '@/api/round'
interface Props {
balance: string
@@ -179,19 +178,24 @@ watch(recipientRegistryAddress, () => loadProjects())
async function loadProjects(): Promise {
isLoading.value = true
- let _projects: Project[] = []
+ let _projects: Project[] | undefined = undefined
- if (isActiveApp) {
- if (!recipientRegistryAddress.value) return
+ if (!recipientRegistryAddress.value) return
+
+ const currentRoundAddress = currentRound.value?.fundingRoundAddress
+ if (currentRoundAddress) {
+ const round = await getRoundInfo(currentRoundAddress, currentRound.value)
+ if (round?.projects) {
+ _projects = round.projects
+ }
+ }
+
+ if (!_projects) {
_projects = await getProjects(
recipientRegistryAddress.value,
currentRound.value?.startTime.toSeconds(),
currentRound.value?.votingDeadline.toSeconds(),
)
- } else {
- const currentRoundAddress = currentRound.value?.fundingRoundAddress || ''
- const network = currentRound.value?.network || ''
- _projects = await getProjectsForStaticRound(currentRoundAddress, network)
}
const userProjects: Project[] = _projects.filter(
diff --git a/vue-app/src/views/ProjectList.vue b/vue-app/src/views/ProjectList.vue
index 8bc21b7c5..83fa0450a 100644
--- a/vue-app/src/views/ProjectList.vue
+++ b/vue-app/src/views/ProjectList.vue
@@ -60,7 +60,7 @@
import { ref, computed, onMounted } from 'vue'
import { getCurrentRound, getRoundInfo } from '@/api/round'
-import { type Project, getProjects, getRecipientRegistryAddress, getProjectsForStaticRound } from '@/api/projects'
+import { type Project, getProjects, getRecipientRegistryAddress } from '@/api/projects'
import CallToActionCard from '@/components/CallToActionCard.vue'
import ProjectListItem from '@/components/ProjectListItem.vue'
@@ -70,7 +70,6 @@ import { useRoute } from 'vue-router'
import { useAppStore, useUserStore } from '@/stores'
import { storeToRefs } from 'pinia'
import { DateTime } from 'luxon'
-import { isActiveApp } from '@/api/core'
import { getSecondsFromNow } from '@/utils/dates'
type ProjectRoundInfo = {
@@ -124,10 +123,7 @@ onMounted(async () => {
roundAddress.value =
(route.params.address as string) || currentRoundAddress.value || (await getCurrentRound()) || ''
- const round = isActiveApp
- ? await loadProjectRoundInfo(roundAddress.value)
- : await loadStaticRoundInfo(roundAddress.value)
- await loadProjects(round)
+ await loadProjectRoundInfo(roundAddress.value)
} catch (err) {
/* eslint-disable-next-line no-console */
console.error('Error loading projects', err)
@@ -135,11 +131,13 @@ onMounted(async () => {
isLoading.value = false
})
-async function loadProjectRoundInfo(roundAddress: string): Promise {
+async function loadProjectRoundInfo(roundAddress: string) {
// defaults when a round has not been created yet
let recipientRegistryAddress = ''
let startTime = 0
let votingDeadline = DateTime.local().toSeconds()
+ let network = ''
+ let roundProjects: Project[] | undefined = undefined
if (roundAddress) {
const round = await getRoundInfo(roundAddress, currentRound.value)
@@ -147,6 +145,10 @@ async function loadProjectRoundInfo(roundAddress: string): Promise {
- await appStore.loadClrFundInfo()
- const network = currentRound.value?.network || ''
- const recipientRegistryAddress = currentRound.value?.recipientRegistryAddress || ''
- const startTime = getSecondsFromNow(currentRound.value?.startTime || DateTime.now())
- const votingDeadline = getSecondsFromNow(currentRound.value?.votingDeadline || DateTime.now())
- return { recipientRegistryAddress, startTime, votingDeadline, fundingRoundAddress: roundAddress, network }
-}
+ if (!roundProjects) {
+ roundProjects = await getProjects(recipientRegistryAddress, startTime, votingDeadline)
+ }
-async function loadProjects(round: ProjectRoundInfo) {
- const _projects = isActiveApp
- ? await getProjects(round.recipientRegistryAddress, round.startTime, round.votingDeadline)
- : await getProjectsForStaticRound(roundAddress.value, round.network)
- const visibleProjects = _projects.filter(project => {
+ const visibleProjects = roundProjects.filter(project => {
return !project.isHidden && !project.isLocked
})
shuffleArray(visibleProjects)