diff --git a/web/template/popup-chat.gohtml b/web/template/popup-chat.gohtml index ba0c9f442..7f7e22496 100644 --- a/web/template/popup-chat.gohtml +++ b/web/template/popup-chat.gohtml @@ -17,6 +17,6 @@ - + {{template "chat-component" .}} diff --git a/web/ts/components/popup.ts b/web/ts/components/popup.ts index 568f18a89..2004f2261 100644 --- a/web/ts/components/popup.ts +++ b/web/ts/components/popup.ts @@ -13,3 +13,11 @@ export function popupContext(streamId: number): AlpineComponent { }, } as AlpineComponent; } + +export function closeChatOnEscapePressed() { + document.addEventListener("keyup", function (event) { + if (event.key === "Escape") { + window.close(); + } + }); +}