(null);
const battleReward = battleRewardUi.reward;
@@ -734,6 +759,10 @@ export function AdventurePanel({
setSelectedBattleRewardItemId(null);
}, [battleReward]);
+ useEffect(() => {
+ setNpcChatDraft('');
+ }, [npcChatState?.npcId, npcChatState?.turnCount]);
+
useEffect(() => {
if (!primaryQuestGoal) {
return;
@@ -887,6 +916,18 @@ export function AdventurePanel({
onDismissGoalPulse();
};
+ const submitNpcChatDraft = () => {
+ const nextInput = npcChatDraft.trim();
+ if (!nextInput || !onSubmitNpcChatInput) {
+ return;
+ }
+
+ const submitted = onSubmitNpcChatInput(nextInput);
+ if (submitted) {
+ setNpcChatDraft('');
+ }
+ };
+
return (