Skip to content

Commit fd82a2e

Browse files
committed
Add loggedIn check to gameboard auto saving
1 parent 8374830 commit fd82a2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/components/content/IsaacQuestion.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from "../../services/fastTrack";
1717
import {SITE, SITE_SUBJECT} from "../../services/siteConstants";
1818
import {IsaacLinkHints, IsaacTabbedHints} from "./IsaacHints";
19+
import {isLoggedIn} from "../../services/user";
1920

2021
export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.IsaacQuestionBaseDTO} & RouteComponentProps) => {
2122
const dispatch = useDispatch();
@@ -53,7 +54,7 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.IsaacQu
5354
if (event) {event.preventDefault();}
5455
if (questionPart?.currentAttempt) {
5556
dispatch(attemptQuestion(doc.id as string, questionPart?.currentAttempt));
56-
if (currentUser && currentGameboard?.id && !currentGameboard.savedToCurrentUser) {
57+
if (isLoggedIn(currentUser) && currentGameboard?.id && !currentGameboard.savedToCurrentUser) {
5758
dispatch(addGameboard(currentGameboard.id, currentUser));
5859
}
5960
}

0 commit comments

Comments
 (0)