Skip to content

Commit e5fc734

Browse files
committed
Fix question refresh too quick
1 parent 10fa659 commit e5fc734

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

web/components/answers/compatibility-questions-display.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {usePersistentInMemoryState} from 'web/hooks/use-persistent-in-memory-sta
4242
import {useIsLooking} from 'web/hooks/use-is-looking'
4343
import {DropdownButton} from '../filters/desktop-filters'
4444
import {buildArray} from 'common/util/array'
45+
import toast from "react-hot-toast";
4546

4647
const NUM_QUESTIONS_TO_SHOW = 8
4748

@@ -407,7 +408,10 @@ export function CompatibilityAnswerBlock(props: {
407408
name: 'Delete',
408409
icon: <TrashIcon className="h-5 w-5"/>,
409410
onClick: () => {
410-
deleteCompatibilityAnswer(answer.id, user.id).then(() => refreshCompatibilityAll())
411+
deleteCompatibilityAnswer(answer.id, user.id)
412+
.then(() => refreshCompatibilityAll())
413+
.catch((e) => {toast.error(e.message)})
414+
.finally(() => {})
411415
},
412416
},
413417
]}
@@ -425,9 +429,9 @@ export function CompatibilityAnswerBlock(props: {
425429
icon: <TrashIcon className="h-5 w-5"/>,
426430
onClick: () => {
427431
submitCompatibilityAnswer(getEmptyAnswer(user.id, question.id))
428-
.then(() => {})
432+
.then(() => {refreshCompatibilityAll()})
433+
.catch((e) => {toast.error(e.message)})
429434
.finally(() => {})
430-
refreshCompatibilityAll()
431435
},
432436
},
433437
]}

0 commit comments

Comments
 (0)