fix: branching modal
This commit is contained in:
parent
da7bcc842a
commit
9aec2d8e86
@ -24,13 +24,14 @@ import { DeleteIcon } from "@icons/questionsPage/deleteIcon";
|
||||
import { TypeSwitch, BlockRule } from "./Settings";
|
||||
import { getQuestionById, getQuestionByContentId, updateOpenedModalSettingsId, updateQuestion } from "@root/questions/actions";
|
||||
import { useQuestionsStore } from "@root/questions/store";
|
||||
import { useUiTools } from "@root/uiTools/store";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
|
||||
|
||||
export default function BranchingQuestions() {
|
||||
const theme = useTheme();
|
||||
|
||||
const { openedModalSettingsId } = useQuestionsStore();
|
||||
const { openedModalSettingsId } = useUiTools();
|
||||
const [targetQuestion, setTargetQuestion] = useState<AnyTypedQuizQuestion | null>(getQuestionById(openedModalSettingsId) || getQuestionByContentId(openedModalSettingsId))
|
||||
const [parentQuestion, setParentQuestion] = useState<AnyTypedQuizQuestion | null>(getQuestionByContentId(targetQuestion?.content.rule.parentId))
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@ import { useQuestionsStore } from "@root/questions/store";
|
||||
import { updateOpenBranchingPanel, updateEditSomeQuestion } from "@root/uiTools/actions";
|
||||
import { useUiTools } from "@root/uiTools/store";
|
||||
|
||||
|
||||
export default function QuestionsPage() {
|
||||
const theme = useTheme();
|
||||
const { openedModalSettingsId, openBranchingPanel } = useUiTools();
|
||||
|
||||
@ -13,6 +13,7 @@ import { RequestQueue } from "../../utils/requestQueue";
|
||||
import { updateRootContentId } from "@root/quizes/actions";
|
||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||
import { QuestionsStore, useQuestionsStore } from "./store";
|
||||
import { useUiTools } from "../uiTools/store";
|
||||
import { withErrorBoundary } from "react-error-boundary";
|
||||
|
||||
|
||||
@ -478,7 +479,7 @@ export const getQuestionByContentId = (questionContentId: string | null) => {
|
||||
}) || null;
|
||||
};
|
||||
|
||||
export const updateOpenedModalSettingsId = (id?: string) => useQuestionsStore.setState({ openedModalSettingsId: id ? id : null });
|
||||
export const updateOpenedModalSettingsId = (id?: string) => useUiTools.setState({ openedModalSettingsId: id ? id : null });
|
||||
|
||||
|
||||
export const clearRuleForAll = () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user