Use hook properly when doing upgrade check

This commit is contained in:
Gabe Kangas 2021-02-17 11:56:34 -08:00
parent 69d194f20d
commit b647e7d575

View file

@ -30,8 +30,6 @@ import { TEXTFIELD_PROPS_STREAM_TITLE } from '../utils/config-constants';
import { UpdateArgs } from '../types/config-section';
let performedUpgradeCheck = false;
export default function MainLayout(props) {
const { children } = props;
@ -60,11 +58,8 @@ export default function MainLayout(props) {
};
useEffect(() => {
if (!performedUpgradeCheck) {
checkForUpgrade();
performedUpgradeCheck = true;
}
});
checkForUpgrade();
}, [versionNumber]);
useEffect(() => {
setCurrentStreamTitle(instanceDetails.streamTitle);