Skip to content

Commit

Permalink
fix: handled multiselect bug and refetch rev data (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmelKun authored Dec 6, 2023
1 parent 6cd0c44 commit bc54195
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
23 changes: 12 additions & 11 deletions apps/expo/src/screens/create-reviewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ import useQuestionStore from "../../stores/useQuestionStore";
import { AppButton } from "../../components/buttons/AppButton";
import * as DocumentPicker from "expo-document-picker";
import * as FileSystem from "expo-file-system";
import {
extractHighlightedText,
} from "../../utils/helpers/strings";
import { extractHighlightedText } from "../../utils/helpers/strings";

interface CacheOptions {
name: string;
Expand Down Expand Up @@ -90,14 +88,15 @@ export const CreateReviewerScreen = ({
const resetReviewerImage = useImageStore((state) => state.resetReviewerImage);
const goBack = useGoBack();

const { data: reviewerDetails } = trpc.reviewer.getReviewerById.useQuery(
{
reviewerId: reviewerId ?? "",
},
{
enabled: reviewerId !== undefined,
},
);
const { data: reviewerDetails, refetch: refetchReviewerDetails } =
trpc.reviewer.getReviewerById.useQuery(
{
reviewerId: reviewerId ?? "",
},
{
enabled: reviewerId !== undefined,
},
);

const { mutate: readFile } = trpc.pdfTextExtraction.extractText.useMutation();

Expand Down Expand Up @@ -300,6 +299,7 @@ export const CreateReviewerScreen = ({
},
{
onSuccess: () => {
refetchReviewerDetails();
successToast({
title: "Success",
message: "Reviewer updated successfully",
Expand Down Expand Up @@ -330,6 +330,7 @@ export const CreateReviewerScreen = ({
},
{
onSuccess: () => {
refetchReviewerDetails();
successToast({
title: "Success",
message: "Reviewer created successfully",
Expand Down
3 changes: 1 addition & 2 deletions apps/expo/src/screens/play-test/TestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { AppButton } from "../../components/buttons/AppButton";

import type { ChoiceStyle } from "../create-question/types";
import type { ChoiceStatus } from "./index";
import DoubleBarsIcon from "../../icons/DoubleBarsIcon";
import CheckIcon from "../../icons/CheckIcon";

export const choiceStyles: ChoiceStyle[] = [
Expand Down Expand Up @@ -234,7 +233,7 @@ export const MultiSelectCard = ({
) : null}
{!isDone ? (
<View className="absolute right-4 top-[19px] h-5 w-5">
{isSelected ? <CheckIcon /> : <DoubleBarsIcon />}
{isSelected ? <CheckIcon /> : ""}
</View>
) : null}
<View className="h-full w-full items-center justify-center">
Expand Down
1 change: 1 addition & 0 deletions apps/expo/src/screens/play-test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ export const PlayTestScreen: FC<RootStackScreenProps<"PlayTest">> = ({

upperBarRef.current?.hide();
setIsDone(false);
setChoiceStatus([false, false, false, false]);
};

const showUpperBar = () => {
Expand Down

0 comments on commit bc54195

Please sign in to comment.