mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: always dimiss select state regardless of modification #341
This commit is contained in:
parent
a7defca2c3
commit
53bae7cbb3
4 changed files with 6 additions and 5 deletions
|
|
@ -46,17 +46,17 @@ function Activity(props: any) {
|
|||
modifiedActivity?.activityId === activityId &&
|
||||
selectedActivity !== undefined
|
||||
) {
|
||||
setSelectedActivity(undefined)
|
||||
let modifiedActivityCopy = {
|
||||
...props.activity,
|
||||
name: modifiedActivity.activityName,
|
||||
}
|
||||
|
||||
|
||||
await updateActivity(modifiedActivityCopy, activityId, session.data?.tokens?.access_token)
|
||||
await mutate(`${getAPIUrl()}chapters/meta/course_${props.courseid}`)
|
||||
await revalidateTags(['courses'], props.orgslug)
|
||||
router.refresh()
|
||||
}
|
||||
setSelectedActivity(undefined)
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ function Chapter(props: any) {
|
|||
|
||||
async function updateChapterName(chapterId: string) {
|
||||
if (modifiedChapter?.chapterId === chapterId) {
|
||||
setSelectedChapter(undefined)
|
||||
let modifiedChapterCopy = {
|
||||
name: modifiedChapter.chapterName,
|
||||
}
|
||||
|
|
@ -37,6 +36,7 @@ function Chapter(props: any) {
|
|||
await revalidateTags(['courses'], props.orgslug)
|
||||
router.refresh()
|
||||
}
|
||||
setSelectedChapter(undefined)
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue