From c1878119d068386066ab2666825a42f8866e953d Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sat, 14 May 2022 14:46:18 -0700 Subject: [PATCH] fix version display --- src/ui/components/TopBar.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ui/components/TopBar.tsx b/src/ui/components/TopBar.tsx index 4ca2685..d2459bd 100644 --- a/src/ui/components/TopBar.tsx +++ b/src/ui/components/TopBar.tsx @@ -19,13 +19,19 @@ interface IProps { interface IState { version: string; } + export default class TopBar extends React.Component { constructor(props: IProps) { super(props) - app.getVersion().then(version => { - this.state = { version } - }) + this.state = { version: '0.0.0' } + + + } + + async componentDidMount() { + const version = await app.getVersion() + this.setState({ version }) } handleClose() {