Skip to content

Commit

Permalink
refactor(dashboard): improve ux when creating a group
Browse files Browse the repository at this point in the history
  • Loading branch information
vplasencia committed Nov 29, 2023
1 parent c990ac3 commit 88312af
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { formatBytes32String } from "@ethersproject/strings"
import { getSemaphoreContract } from "@bandada/utils"
import { Box, Button, Heading, HStack, VStack } from "@chakra-ui/react"
import { useCallback, useState } from "react"
Expand Down Expand Up @@ -29,7 +30,8 @@ export default function FinalPreviewStep({

await semaphore.createGroup(group.name, group.treeDepth, admin)

navigate("/groups")
const groupId = BigInt(formatBytes32String(group.name))
navigate(`/groups/on-chain/${groupId}`)
} catch (error) {
setLoading(false)
alert(
Expand All @@ -53,8 +55,7 @@ export default function FinalPreviewStep({

return
}

navigate("/groups")
navigate(`/groups/off-chain/${response.id}`)
}
}, [group, signer, navigate])

Expand Down

0 comments on commit 88312af

Please sign in to comment.