Skip to content

Commit

Permalink
fix(guardian-ui): runConsensus in VerifyGuardians before continuing
Browse files Browse the repository at this point in the history
  • Loading branch information
wbobeirne committed Sep 7, 2023
1 parent f40a263 commit 5bd83d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 18 additions & 1 deletion apps/guardian-ui/src/components/VerifyGuardians.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Tag,
useTheme,
HStack,
CircularProgress,
} from '@chakra-ui/react';
import { CopyInput, FormGroup, Table } from '@fedimint/ui';
import { useConsensusPolling, useSetupContext } from '../hooks';
Expand Down Expand Up @@ -88,7 +89,12 @@ export const VerifyGuardians: React.FC<Props> = ({ next }) => {
useEffect(() => {
// If we're the only guardian, skip this verify other guardians step.
if (numPeers === 1) {
next();
api
.startConsensus()
.then(next)
.catch((err) => {
setError(formatApiErrorMessage(err));
});
return;
}
const isAllValid =
Expand Down Expand Up @@ -191,6 +197,17 @@ export const VerifyGuardians: React.FC<Props> = ({ next }) => {
);
} else if (!peersWithHash) {
return <Spinner />;
} else if (numPeers === 1) {
return (
<VStack gap={8} justify='center' align='center'>
<CircularProgress
isIndeterminate
color={theme.colors.blue[400]}
size='200px'
/>
<Heading size='sm'>{t('verify-guardians.starting-consensus')}</Heading>
</VStack>
);
} else {
return (
<VStack gap={8} justify='start' align='start'>
Expand Down
3 changes: 2 additions & 1 deletion apps/guardian-ui/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
"table-column-status": "Status",
"table-column-hash-input": "Paste verification code",
"wait-all-guardians-verification": "Waiting for all Guardians to verify their codes",
"all-guardians-verified": "All Guardians have verified their codes"
"all-guardians-verified": "All Guardians have verified their codes",
"starting-consensus": "Starting consensus..."
},
"footer": {
"docs-section-header": "Docs",
Expand Down

0 comments on commit 5bd83d3

Please sign in to comment.