Skip to content

Commit

Permalink
Merge pull request #6149 from mozilla/fix-for-chat-side-bar-hotkey
Browse files Browse the repository at this point in the history
fix: hot key t now closes the chat sidebar when not in focus
  • Loading branch information
nikk15 authored Jun 27, 2023
2 parents e7d85ec + f39e542 commit 31373a2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/react-components/ui-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,15 @@ class UIRoot extends Component {
}

onFocusChat = e => {
this.setSidebar("chat", {
chatPrefix: e.detail.prefix,
chatAutofocus: true
});
// Close chat sidebar when hotkey is pressed whilst chat input is not in focus
if (this.state.sidebarId === "chat") {
this.setSidebar(null);
} else {
this.setSidebar("chat", {
chatPrefix: e.detail.prefix,
chatAutofocus: true
});
}
};

renderInterstitialPrompt = () => {
Expand Down

0 comments on commit 31373a2

Please sign in to comment.