Fix linting issues.

This commit is contained in:
Chris Witterholt 2023-02-07 20:20:01 +01:00
parent b0a8dd2b27
commit ec9515d692
No known key found for this signature in database
GPG Key ID: 66C03249E4759AE9
2 changed files with 14 additions and 14 deletions

View File

@ -71,19 +71,19 @@ export class AppComponent implements OnInit {
);
this.hotKeysService.addShortcut({ keys: 'Space' }).subscribe(_ =>
{
if (this.state.displayMode != DisplayMode.Presentation) {
if (this.state.displayMode !== DisplayMode.Presentation) {
this.showDisplay();
}
}
);
this.hotKeysService.addShortcut({ keys: 't' }).subscribe(_ =>
this.state.displayMode == DisplayMode.Theme ? this.showDisplay() : this.themeDisplay()
this.state.displayMode === DisplayMode.Theme ? this.showDisplay() : this.themeDisplay()
);
this.hotKeysService.addShortcut({ keys: 'code.Period' }).subscribe(_ =>
this.state.displayMode == DisplayMode.Blank ? this.showDisplay() : this.blankDisplay()
this.state.displayMode === DisplayMode.Blank ? this.showDisplay() : this.blankDisplay()
);
this.hotKeysService.addShortcut({ keys: 'd' }).subscribe(_ =>
this.state.displayMode == DisplayMode.Desktop ? this.showDisplay() : this.desktopDisplay()
this.state.displayMode === DisplayMode.Desktop ? this.showDisplay() : this.desktopDisplay()
);
}

View File

@ -1,18 +1,18 @@
import { DOCUMENT } from "@angular/common";
import { Inject, Injectable } from "@angular/core";
import { EventManager } from "@angular/platform-browser";
import { Observable } from "rxjs";
import { DOCUMENT } from '@angular/common';
import { Inject, Injectable } from '@angular/core';
import { EventManager } from '@angular/platform-browser';
import { Observable } from 'rxjs';
type Options = {
interface Options {
element: any;
keys: string;
}
};
@Injectable({ providedIn: 'root' })
export class HotKeysService {
defaults: Partial<Options> = {
element: this.document
}
};
constructor(private eventManager: EventManager, @Inject(DOCUMENT) private document: Document) {
}
@ -25,7 +25,7 @@ export class HotKeysService {
const handler = (e: KeyboardEvent) => {
if (document.URL.endsWith('/slides'))
{
e.preventDefault()
e.preventDefault();
observer.next(e);
}
};
@ -37,6 +37,6 @@ export class HotKeysService {
return () => {
dispose();
};
})
});
}
}
}