From 88312af62e3ef0afb7aeee78b5fc2756f6697f43 Mon Sep 17 00:00:00 2001 From: vplasencia Date: Wed, 29 Nov 2023 12:26:14 +0100 Subject: [PATCH] refactor(dashboard): improve ux when creating a group --- .../components/new-group-stepper/final-preview-step.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/src/components/new-group-stepper/final-preview-step.tsx b/apps/dashboard/src/components/new-group-stepper/final-preview-step.tsx index fcddf4ab..9d1c8d17 100644 --- a/apps/dashboard/src/components/new-group-stepper/final-preview-step.tsx +++ b/apps/dashboard/src/components/new-group-stepper/final-preview-step.tsx @@ -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" @@ -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( @@ -53,8 +55,7 @@ export default function FinalPreviewStep({ return } - - navigate("/groups") + navigate(`/groups/off-chain/${response.id}`) } }, [group, signer, navigate])