More use effect effeciency.

This commit is contained in:
Lucid Kobold
2022-06-23 13:59:43 -05:00
parent 488f56354d
commit f808f6b250
4 changed files with 26 additions and 12 deletions

View File

@@ -39,9 +39,8 @@ const IndexPage = (): JSX.Element => {
};
useEffect(() => {
if (completedTutorial === null || tutorialCompletionInfo === null) {
if (completedTutorial === null && tutorialCompletionInfo === null) {
dispatch(getAndSetTutorial());
dispatch(updateLoading(false));
}
if (completedTutorial !== null) {
@@ -63,6 +62,7 @@ const IndexPage = (): JSX.Element => {
<Tutorial
setTutorialComplete={handleTutorialCompleted}
setTempTutorialComplete={handleTempTutorialCompleted}
isLoading={isLoading}
/>
)}
</Provider>