Skip to content

Commit 94175ee

Browse files
fix: restore lose chat focus on escape (#5721)
1 parent d938ebf commit 94175ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Explorer/Assets/DCL/Chat/_Refactor/ChatPanelPresenter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public ChatPanelPresenter(ChatPanelView view,
7171

7272
uiScope = new EventSubscriptionScope();
7373
DCLInput.Instance.Shortcuts.OpenChatCommandLine.performed += OnOpenChatCommandLineShortcutPerformed;
74+
DCLInput.Instance.UI.Close.performed += OnUIClose;
7475
uiScope.Add(eventBus.Subscribe<ChatEvents.ChatStateChangedEvent>(OnChatStateChanged));
7576

7677
communityVoiceChatSubTitleButtonPresenter = new CommunityVoiceChatSubTitleButtonPresenter(
@@ -186,15 +187,17 @@ private void OnOpenChatCommandLineShortcutPerformed(InputAction.CallbackContext
186187
}
187188
}
188189

189-
public void OnUIClose()
190+
private void OnUIClose(InputAction.CallbackContext obj)
190191
{
191192
if (chatStateMachine.IsMinimized) return;
193+
192194
chatStateMachine.SetVisibility(true);
193195
}
194196

195197
public void Dispose()
196198
{
197199
DCLInput.Instance.Shortcuts.OpenChatCommandLine.performed -= OnOpenChatCommandLineShortcutPerformed;
200+
DCLInput.Instance.UI.Close.performed -= OnUIClose;
198201

199202
initCts.SafeCancelAndDispose();
200203

0 commit comments

Comments
 (0)