Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(guardian-ui): run consensus in VerifyGuardians before continuing #189

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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