fixed by merge

This commit is contained in:
moririn2528
2023-09-14 15:20:46 +09:00
parent f0449acc20
commit 4d15b79e9b
2 changed files with 6 additions and 5 deletions
@@ -142,7 +142,7 @@ const ChoiceTrials: FC<{
trials: Trial[]
study_id: number
}> = ({ choice, trials, study_id }) => {
const [isRemoved, setRemoved] = useState(choice.isRemoved)
const [isRemoved, setRemoved] = useState(choice.is_removed)
const theme = useTheme()
const worst_trials = new Set([choice.clicked])
const action = actionCreator()
@@ -170,7 +170,7 @@ const ChoiceTrials: FC<{
>
{formatDate(choice.timestamp)}
</Typography>
{choice.isRemoved ? (
{choice.is_removed ? (
<IconButton
disabled={!isRemoved}
onClick={() => {
@@ -203,7 +203,7 @@ const ChoiceTrials: FC<{
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
filter: choice.isRemoved ? "brightness(0.4)" : undefined,
filter: choice.is_removed ? "brightness(0.4)" : undefined,
backgroundColor: theme.palette.background.paper,
}}
>
@@ -196,7 +196,8 @@ export const PreferentialTrials: FC<{ studyDetail: StudyDetail | null }> = ({
const hiddenTrials = new Set(
studyDetail.preference_history
?.map((p) => p.clicked)
?.filter((h) => !h.is_removed)
.map((p) => p.clicked)
.concat(studyDetail.skipped_trials) ?? []
)
const activeTrials = studyDetail.trials.filter(
@@ -256,7 +257,7 @@ export const PreferentialTrials: FC<{ studyDetail: StudyDetail | null }> = ({
})
}
const latestHistoryId =
studyDetail?.preference_history?.filter((h) => !h.isRemoved).pop()?.id ??
studyDetail?.preference_history?.filter((h) => !h.is_removed).pop()?.id ??
null
if (undoHistoryId !== null && undoHistoryId !== latestHistoryId) {
setUndoHistoryId(null)