From 922f9babb1a6263b821cb879af4ed416c07d9469 Mon Sep 17 00:00:00 2001 From: Levi Harrison Date: Thu, 17 Jun 2021 06:48:38 -0400 Subject: [PATCH] Change starting show screen progress bar condition (#8946) * Show progress bar when max is not 0 Signed-off-by: Levi Harrison * Added semicolon Signed-off-by: Levi Harrison --- .../src/components/withStartingIndicator.test.tsx | 11 +++++++++++ .../src/components/withStartingIndicator.tsx | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/web/ui/react-app/src/components/withStartingIndicator.test.tsx b/web/ui/react-app/src/components/withStartingIndicator.test.tsx index ec4fd25f3..575115ba6 100644 --- a/web/ui/react-app/src/components/withStartingIndicator.test.tsx +++ b/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(); + const progress = starting.find(Progress); + expect(progress).toHaveLength(1); + }); + it('renders progress correctly', () => { const status: WALReplayData = { min: 0, diff --git a/web/ui/react-app/src/components/withStartingIndicator.tsx b/web/ui/react-app/src/components/withStartingIndicator.tsx index a935913a0..8f15d854e 100644 --- a/web/ui/react-app/src/components/withStartingIndicator.tsx +++ b/web/ui/react-app/src/components/withStartingIndicator.tsx @@ -23,7 +23,7 @@ export const StartingContent: FC = ({ status, isUnexpected

Starting up...

- {status?.current! > status?.min! ? ( + {status?.max! > 0 ? (

Replaying WAL ({status?.current}/{status?.max})