Commit ede54487 authored by Chunchi Che's avatar Chunchi Che

clear hint when modal close

parent e130440c
...@@ -109,6 +109,12 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({ ...@@ -109,6 +109,12 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
disabled: !submitable, disabled: !submitable,
}} }}
open={isOpen} open={isOpen}
afterClose={() => {
// Modal每次展示时都会消费`esHint`和`esSelectHint`,
// 否则这些提示会保留到下一次Modal展示,可能会疑惑玩家
matStore.hint.esHint = undefined;
matStore.hint.esSelectHint = undefined;
}}
footer={ footer={
<> <>
{cancelable && <Button onClick={onCancel}>{cancelText}</Button>} {cancelable && <Button onClick={onCancel}>{cancelText}</Button>}
......
...@@ -26,6 +26,7 @@ export const YesNoModal: React.FC = () => { ...@@ -26,6 +26,7 @@ export const YesNoModal: React.FC = () => {
title={`${preHintMsg} ${msg}`} title={`${preHintMsg} ${msg}`}
open={isOpen} open={isOpen}
width={400} width={400}
afterClose={() => (matStore.hint.esHint = undefined)}
footer={ footer={
<> <>
<Button <Button
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment