Browse Source

Change starting show screen progress bar condition (#8946)

* Show progress bar when max is not 0

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added semicolon

Signed-off-by: Levi Harrison <git@leviharrison.dev>
pull/8953/head
Levi Harrison 3 years ago committed by GitHub
parent
commit
922f9babb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      web/ui/react-app/src/components/withStartingIndicator.test.tsx
  2. 2
      web/ui/react-app/src/components/withStartingIndicator.tsx

11
web/ui/react-app/src/components/withStartingIndicator.test.tsx

@ -17,6 +17,17 @@ describe('Starting', () => {
expect(progress).toHaveLength(0);
});
it('shows progress bar when max is not 0', () => {
const status: WALReplayData = {
min: 0,
max: 1,
current: 0,
};
const starting = shallow(<StartingContent status={status} isUnexpected={false} />);
const progress = starting.find(Progress);
expect(progress).toHaveLength(1);
});
it('renders progress correctly', () => {
const status: WALReplayData = {
min: 0,

2
web/ui/react-app/src/components/withStartingIndicator.tsx

@ -23,7 +23,7 @@ export const StartingContent: FC<StartingContentProps> = ({ status, isUnexpected
<div className="text-center m-3">
<div className="m-4">
<h2>Starting up...</h2>
{status?.current! > status?.min! ? (
{status?.max! > 0 ? (
<div>
<p>
Replaying WAL ({status?.current}/{status?.max})

Loading…
Cancel
Save