Skip to content

Commit

Permalink
Merge pull request #113 from privacy-scaling-explorations/feat/nico/h…
Browse files Browse the repository at this point in the history
…ide-specific-ceremonies

Hide specific ceremonies
  • Loading branch information
glamperd authored Apr 9, 2024
2 parents d14ab1d + b7a5542 commit 8605425
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions web/src/context/StateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -134,22 +135,22 @@ export const useInitialStateContext = () => {
}

setWaitingQueue(queue)
// 3. Store data.
// 3. Store data.
setProjects(projects)
setLoading(false)
}

setRunTutorial(true)

fetchData()

},[])

return { waitingQueue, projects, setProjects, circuit, setCircuit, search, setSearch, loading, setLoading, runTutorial, setRunTutorial };
};

export const StateProvider: React.FC<StateProviderProps> = ({ children }) => {

const [user, setUser] = useState<string | undefined>(
localStorage.getItem("username") || undefined
);
Expand Down
11 changes: 6 additions & 5 deletions web/src/helpers/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export interface CeremonyDocument {
type: CeremonyType
coordinatorId: string
lastUpdated: number
hideInWeb?: boolean
}

/**
Expand Down Expand Up @@ -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
}

/**
Expand All @@ -513,7 +514,7 @@ export interface Project {
circuits?: CircuitDocumentReferenceAndData[] | null
participants?: ParticipantDocumentReferenceAndData[] | null
contributions?: ContributionDocumentReferenceAndData[] | null
coordinatorId?: string
coordinatorId?: string
}

export interface State {
Expand Down Expand Up @@ -578,6 +579,6 @@ export type StateProviderProps = {
* @property {string} hash - the hash of the beacon.
*/
export interface FinalBeacon {
beacon: string
beacon: string
beaconHash: string
}

0 comments on commit 8605425

Please sign in to comment.