Skip to content

Commit bf75630

Browse files
committed
fix(challenges): prefer to fetch the latest submissions
1 parent 311520a commit bf75630

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

app/(app)/challenges/[id]/_components/ide/compare-answer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const Modified = CodeMirrorMerge.Modified;
4040
export default function CompareAnswer({ id }: CompareAnswerProps) {
4141
const { data } = useSuspenseQuery(COMPARE_ANSWER_QUERY, {
4242
variables: { id },
43+
fetchPolicy: "cache-and-network",
4344
});
4445

4546
const { referenceAnswerResult, lastSubmission } = data.question;

app/(app)/challenges/[id]/_components/ide/my-answer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const MY_ANSWER = graphql(`
2929
export default function MyAnswer({ id }: MyAnswerProps) {
3030
const { data } = useSuspenseQuery(MY_ANSWER, {
3131
variables: { id },
32+
fetchPolicy: "cache-and-network",
3233
});
3334

3435
if (!data.question.lastSubmission) {

app/(app)/challenges/[id]/_components/ide/submission-history.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ function CodePreview({
8787
export default function SubmissionHistory({ id }: SubmissionHistoryProps) {
8888
const { data } = useSuspenseQuery(SUBMISSION_HISTORY, {
8989
variables: { id },
90+
fetchPolicy: "cache-and-network",
9091
});
9192

9293
const submissions = data?.question?.userSubmissions || [];

0 commit comments

Comments
 (0)