diff --git a/web/src/context/StateContext.tsx b/web/src/context/StateContext.tsx index 7fde008..bb2ab89 100644 --- a/web/src/context/StateContext.tsx +++ b/web/src/context/StateContext.tsx @@ -123,7 +123,8 @@ export const useInitialStateContext = () => { // 2. Post-process data. const ceremonies: CeremonyDocumentReferenceAndData[] = docs.map((document: DocumentData) => { return { uid: document.id, data: document.data() } }) - const projects: Project[] = ceremonies.map((ceremony: CeremonyDocumentReferenceAndData) => { return { ceremony: ceremony } }) + const ceremoniesVisibleInWeb = ceremonies.filter((ceremony) => ceremony.data.hideInWeb !== true) + const projects: Project[] = ceremoniesVisibleInWeb.map((ceremony: CeremonyDocumentReferenceAndData) => { return { ceremony: ceremony } }) const queue: WaitingQueue[] = [] for (const project of projects) { @@ -134,7 +135,7 @@ export const useInitialStateContext = () => { } setWaitingQueue(queue) - // 3. Store data. + // 3. Store data. setProjects(projects) setLoading(false) } @@ -142,14 +143,14 @@ export const useInitialStateContext = () => { setRunTutorial(true) fetchData() - + },[]) return { waitingQueue, projects, setProjects, circuit, setCircuit, search, setSearch, loading, setLoading, runTutorial, setRunTutorial }; }; export const StateProvider: React.FC = ({ children }) => { - + const [user, setUser] = useState( localStorage.getItem("username") || undefined ); diff --git a/web/src/helpers/interfaces.ts b/web/src/helpers/interfaces.ts index 388aa6c..76087f3 100644 --- a/web/src/helpers/interfaces.ts +++ b/web/src/helpers/interfaces.ts @@ -171,6 +171,7 @@ export interface CeremonyDocument { type: CeremonyType coordinatorId: string lastUpdated: number + hideInWeb?: boolean } /** @@ -494,9 +495,9 @@ export interface ZkeyDownloadLink { * @property {number} waitingQueue - the number of participants in the waiting queue. */ export interface WaitingQueue { - ceremonyName: string - circuitName: string - waitingQueue: number + ceremonyName: string + circuitName: string + waitingQueue: number } /** @@ -513,7 +514,7 @@ export interface Project { circuits?: CircuitDocumentReferenceAndData[] | null participants?: ParticipantDocumentReferenceAndData[] | null contributions?: ContributionDocumentReferenceAndData[] | null - coordinatorId?: string + coordinatorId?: string } export interface State { @@ -578,6 +579,6 @@ export type StateProviderProps = { * @property {string} hash - the hash of the beacon. */ export interface FinalBeacon { - beacon: string + beacon: string beaconHash: string }