Reinserting the login button

This commit is contained in:
Mateus Meyer Jiacomelli 2023-02-16 16:25:30 +00:00 committed by Raoul Snyman
parent ca9ca91ac9
commit d33f131479
2 changed files with 8 additions and 4 deletions

View File

@ -3,6 +3,7 @@
<button mat-icon-button (click)="menu.toggle()"><mat-icon>menu</mat-icon></button>
<span class="page-title">{{pageTitle}}</span>
<span class="spacer"></span>
<button *ngIf="showLogin" mat-button (click)="login()">Login</button>
<button
mat-icon-button
(click)="forceWebSocketReconnection()"

View File

@ -23,10 +23,13 @@ export class HotKeysService {
return new Observable(observer => {
const handler = (e: KeyboardEvent) => {
if (document.URL.endsWith('/slides'))
{
e.preventDefault();
observer.next(e);
const activeElement = this.document.activeElement;
const notOnInput = activeElement?.tagName !== 'INPUT' && activeElement?.tagName !== 'TEXTAREA';
if (notOnInput) {
if (document.URL.endsWith('/slides')) {
e.preventDefault();
observer.next(e);
}
}
};