diff --git a/src/src/app/common/components/logo/logo.component.ts b/src/src/app/common/components/logo/logo.component.ts index b32db52..f51abaf 100644 --- a/src/src/app/common/components/logo/logo.component.ts +++ b/src/src/app/common/components/logo/logo.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, inject } from '@angular/core'; +import {Component, inject, Input} from '@angular/core'; import {Router} from '@angular/router'; @Component({ @@ -7,8 +7,8 @@ import {Router} from '@angular/router'; templateUrl: './logo.component.html', styleUrl: './logo.component.scss' }) -export class LogoComponent { - private router = inject(Router); +export class LogoComponent { + private router = inject(Router); @Input() height: number = 50; @Input() fontSize: number = 35; diff --git a/src/src/app/common/interface/oauth.ts b/src/src/app/common/interface/oauth.ts index 0a602a0..92b274c 100644 --- a/src/src/app/common/interface/oauth.ts +++ b/src/src/app/common/interface/oauth.ts @@ -1,5 +1,5 @@ export interface OAuth { - bearer: string, - refresh: string, - expiresUtc: string + bearer: string, + refresh: string, + expiresUtc: string } diff --git a/src/src/app/service/nullinside-null.service.ts b/src/src/app/service/nullinside-null.service.ts index 42d8f4c..f35a6c9 100644 --- a/src/src/app/service/nullinside-null.service.ts +++ b/src/src/app/service/nullinside-null.service.ts @@ -1,4 +1,4 @@ -import { Injectable, inject } from '@angular/core'; +import {inject, Injectable} from '@angular/core'; import {Observable} from 'rxjs'; import {environment} from '../../environments/environment'; import {HttpClient} from '@angular/common/http'; @@ -7,8 +7,8 @@ import {ImdbSearch} from '../common/interface/imdb-search'; @Injectable({ providedIn: 'root' }) -export class NullinsideNullService { - private httpClient = inject(HttpClient); +export class NullinsideNullService { + private httpClient = inject(HttpClient); getImdbSearchQuick(search: string): Observable { diff --git a/src/src/app/service/nullinside-twitch-bot.service.ts b/src/src/app/service/nullinside-twitch-bot.service.ts index 6135d9a..c4e8726 100644 --- a/src/src/app/service/nullinside-twitch-bot.service.ts +++ b/src/src/app/service/nullinside-twitch-bot.service.ts @@ -1,4 +1,4 @@ -import { Injectable, inject } from '@angular/core'; +import {inject, Injectable} from '@angular/core'; import {HttpClient} from "@angular/common/http"; import {Observable} from "rxjs"; import {environment} from "../../environments/environment"; @@ -8,8 +8,8 @@ import {TwitchBotConfig} from "../common/interface/twitch-bot-config"; @Injectable({ providedIn: 'root' }) -export class NullinsideTwitchBotService { - private httpClient = inject(HttpClient); +export class NullinsideTwitchBotService { + private httpClient = inject(HttpClient); getIsMod(): Observable { diff --git a/src/src/app/service/nullinside.service.ts b/src/src/app/service/nullinside.service.ts index 67a6e3a..70b29ad 100644 --- a/src/src/app/service/nullinside.service.ts +++ b/src/src/app/service/nullinside.service.ts @@ -1,4 +1,4 @@ -import { Injectable, inject } from '@angular/core'; +import {inject, Injectable} from '@angular/core'; import {HttpClient} from "@angular/common/http"; import {Observable} from "rxjs"; import {environment} from "../../environments/environment"; @@ -9,8 +9,8 @@ import {FeatureToggleResponse} from "../common/interface/feature-toggle-response @Injectable({ providedIn: 'root' }) -export class NullinsideService { - private httpClient = inject(HttpClient); +export class NullinsideService { + private httpClient = inject(HttpClient); validateToken(token: string): Observable { diff --git a/src/src/app/view/home/home.component.ts b/src/src/app/view/home/home.component.ts index a828803..f136cbd 100644 --- a/src/src/app/view/home/home.component.ts +++ b/src/src/app/view/home/home.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, inject } from '@angular/core'; +import {Component, inject, OnInit} from '@angular/core'; import {NullinsideService} from "../../service/nullinside.service"; import {VM_ADMIN} from "../../common/constants"; import {WebsiteApp} from "../../common/interface/website-app"; @@ -17,9 +17,9 @@ import {UserRolesResponse} from "../../common/interface/user-roles-response"; templateUrl: './home.component.html', styleUrl: './home.component.scss' }) -export class HomeComponent implements OnInit { - private api = inject(NullinsideService); - private router = inject(Router); +export class HomeComponent implements OnInit { + private api = inject(NullinsideService); + private router = inject(Router); public roles: string[] | null = null; public error: string | null = null; diff --git a/src/src/app/view/imdb-search/imdb-search.component.ts b/src/src/app/view/imdb-search/imdb-search.component.ts index 67debef..a5280a7 100644 --- a/src/src/app/view/imdb-search/imdb-search.component.ts +++ b/src/src/app/view/imdb-search/imdb-search.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, inject } from '@angular/core'; +import {Component, inject, OnDestroy} from '@angular/core'; import {LogoComponent} from '../../common/components/logo/logo.component'; import {NullinsideNullService} from '../../service/nullinside-null.service'; import {MatFormFieldModule} from '@angular/material/form-field'; @@ -20,8 +20,8 @@ import {ImdbSearchItems} from '../../common/interface/imdb-search'; templateUrl: './imdb-search.component.html', styleUrl: './imdb-search.component.scss' }) -export class ImdbSearchComponent implements OnDestroy { - private api = inject(NullinsideNullService); +export class ImdbSearchComponent implements OnDestroy { + private api = inject(NullinsideNullService); searching: boolean = false; quickSubscription: Subscription | null = null; diff --git a/src/src/app/view/login-landing-desktop/login-landing-desktop.component.ts b/src/src/app/view/login-landing-desktop/login-landing-desktop.component.ts index 5b4956b..449b521 100644 --- a/src/src/app/view/login-landing-desktop/login-landing-desktop.component.ts +++ b/src/src/app/view/login-landing-desktop/login-landing-desktop.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, inject } from '@angular/core'; +import {Component, inject, OnInit} from '@angular/core'; import {ActivatedRoute, ParamMap} from "@angular/router"; import {Errors} from "../login-landing/errors"; import {HttpErrorResponse} from "@angular/common/http"; @@ -10,106 +10,106 @@ import {CdkCopyToClipboard} from "@angular/cdk/clipboard"; import {interval, Subscription} from "rxjs"; @Component({ - selector: 'app-login-landing-desktop', - imports: [ - LoadingIconComponent, - LogoComponent, - MatButton, - CdkCopyToClipboard - ], - templateUrl: './login-landing-desktop.component.html', - styleUrl: './login-landing-desktop.component.scss' + selector: 'app-login-landing-desktop', + imports: [ + LoadingIconComponent, + LogoComponent, + MatButton, + CdkCopyToClipboard + ], + templateUrl: './login-landing-desktop.component.html', + styleUrl: './login-landing-desktop.component.scss' }) export class LoginLandingDesktopComponent implements OnInit { - private route = inject(ActivatedRoute); - private timer: Subscription | undefined; - private desktopData: string | undefined; + private route = inject(ActivatedRoute); + private timer: Subscription | undefined; + private desktopData: string | undefined; - loggedIn: boolean = false; - error: string = ''; - oAuth: OAuth | null = null; - loading: boolean = true; + loggedIn: boolean = false; + error: string = ''; + oAuth: OAuth | null = null; + loading: boolean = true; - ngOnInit(): void { - this.route.queryParamMap.subscribe({ - next: (params: ParamMap) => { - const error = params.get('error'); - if (null !== error) { - const errorNum = +error; - if (Errors.TWITCH_ACCOUNT_HAS_NO_EMAIL === errorNum) { - this.onLoginFailed('Your Twitch account must have a valid e-mail address, please add one and try again') - } else if (Errors.TWITCH_ERROR_WITH_TOKEN === errorNum) { - this.onLoginFailed('Twitch failed to give us a valid token, please try again') - } else { - this.onLoginFailed('Sorry we did something wrong trying to log you in, please try again') - } + ngOnInit(): void { + this.route.queryParamMap.subscribe({ + next: (params: ParamMap) => { + const error = params.get('error'); + if (null !== error) { + const errorNum = +error; + if (Errors.TWITCH_ACCOUNT_HAS_NO_EMAIL === errorNum) { + this.onLoginFailed('Your Twitch account must have a valid e-mail address, please add one and try again') + } else if (Errors.TWITCH_ERROR_WITH_TOKEN === errorNum) { + this.onLoginFailed('Twitch failed to give us a valid token, please try again') + } else { + this.onLoginFailed('Sorry we did something wrong trying to log you in, please try again') + } - return; - } + return; + } - const oAuth = { - bearer: params.get('bearer'), - refresh: params.get('refresh'), - expiresUtc: params.get('expiresUtc'), - }; + const oAuth = { + bearer: params.get('bearer'), + refresh: params.get('refresh'), + expiresUtc: params.get('expiresUtc'), + }; - if (null === oAuth.bearer || null === oAuth.refresh || null === oAuth.expiresUtc) { - this.onLoginFailed(); - return; - } + if (null === oAuth.bearer || null === oAuth.refresh || null === oAuth.expiresUtc) { + this.onLoginFailed(); + return; + } - this.oAuth = { - bearer: oAuth.bearer, - refresh: oAuth.refresh, - expiresUtc: oAuth.expiresUtc - }; + this.oAuth = { + bearer: oAuth.bearer, + refresh: oAuth.refresh, + expiresUtc: oAuth.expiresUtc + }; - // DO NOT assign this.desktopData until AFTER you update the clipboard successfully. - // The absence of a value on this.desktopData is what tells the application we haven't logged in yet. - const json = JSON.stringify(oAuth); - navigator.clipboard.writeText(json); - this.desktopData = json; + // DO NOT assign this.desktopData until AFTER you update the clipboard successfully. + // The absence of a value on this.desktopData is what tells the application we haven't logged in yet. + const json = JSON.stringify(oAuth); + navigator.clipboard.writeText(json); + this.desktopData = json; - this.loading = false; - this.timer = interval(1000) - .subscribe({ - next: _ => { - this.runCheckForLogin(); - }, - error: e => { - console.error(e); - } - }); + this.loading = false; + this.timer = interval(1000) + .subscribe({ + next: _ => { + this.runCheckForLogin(); }, - error: (_: HttpErrorResponse) => { - this.onLoginFailed(); + error: e => { + console.error(e); } - }); - } + }); + }, + error: (_: HttpErrorResponse) => { + this.onLoginFailed(); + } + }); + } - private runCheckForLogin() { - try { - navigator.clipboard.readText().then(text => { - // If the text matches what we put on the clipboard then we aren't signed in yet. - if (undefined === this.desktopData || text === this.desktopData) { - return; - } + private runCheckForLogin() { + try { + navigator.clipboard.readText().then(text => { + // If the text matches what we put on the clipboard then we aren't signed in yet. + if (undefined === this.desktopData || text === this.desktopData) { + return; + } - // If the text does match, we are signed in on the desktop app. Maybe...kinda....might be...you never know... - // Don't judge me. -.- - this.timer?.unsubscribe(); - this.loggedIn = true; - }) - } catch { - // Do nothing, just don't crash. - } + // If the text does match, we are signed in on the desktop app. Maybe...kinda....might be...you never know... + // Don't judge me. -.- + this.timer?.unsubscribe(); + this.loggedIn = true; + }) + } catch { + // Do nothing, just don't crash. } + } - onLoginFailed(message = ':( Failed to login, please try again'): void { - this.error = message; - this.loading = false; - } + onLoginFailed(message = ':( Failed to login, please try again'): void { + this.error = message; + this.loading = false; + } - protected readonly JSON = JSON; - protected readonly window = window; + protected readonly JSON = JSON; + protected readonly window = window; } diff --git a/src/src/app/view/login-landing/login-landing.component.ts b/src/src/app/view/login-landing/login-landing.component.ts index c2d7416..1de8c0f 100644 --- a/src/src/app/view/login-landing/login-landing.component.ts +++ b/src/src/app/view/login-landing/login-landing.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import {Component, inject, OnDestroy, OnInit} from '@angular/core'; import {NullinsideService} from "../../service/nullinside.service"; import {LogoComponent} from "../../common/components/logo/logo.component"; import {LoadingIconComponent} from "../../common/components/loading-icon/loading-icon.component"; diff --git a/src/src/app/view/login/login.component.ts b/src/src/app/view/login/login.component.ts index 530e4cd..675c78c 100644 --- a/src/src/app/view/login/login.component.ts +++ b/src/src/app/view/login/login.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, inject } from '@angular/core'; +import {Component, inject, OnInit} from '@angular/core'; import {LogoComponent} from "../../common/components/logo/logo.component"; import {environment} from "../../../environments/environment"; import {NullinsideService} from "../../service/nullinside.service"; @@ -17,10 +17,10 @@ import {TwitchLoginComponent} from '../../common/components/twitch-login/twitch- templateUrl: './login.component.html', styleUrl: './login.component.scss' }) -export class LoginComponent implements OnInit { - private api = inject(NullinsideService); - private router = inject(Router); - private route = inject(ActivatedRoute); +export class LoginComponent implements OnInit { + private api = inject(NullinsideService); + private router = inject(Router); + private route = inject(ActivatedRoute); loginUrl: string; checkingLogin = false; diff --git a/src/src/app/view/twitch/twitch-bot-config/twitch-bot-config.component.ts b/src/src/app/view/twitch/twitch-bot-config/twitch-bot-config.component.ts index 9bce961..7617cdf 100644 --- a/src/src/app/view/twitch/twitch-bot-config/twitch-bot-config.component.ts +++ b/src/src/app/view/twitch/twitch-bot-config/twitch-bot-config.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import {Component, inject, OnDestroy, OnInit} from '@angular/core'; import {LogoComponent} from '../../../common/components/logo/logo.component'; import {MatButton} from '@angular/material/button'; import {NullinsideTwitchBotService} from "../../../service/nullinside-twitch-bot.service"; diff --git a/src/src/app/view/vm-manager/vm-manager.component.ts b/src/src/app/view/vm-manager/vm-manager.component.ts index e6c2f2e..9b06e90 100644 --- a/src/src/app/view/vm-manager/vm-manager.component.ts +++ b/src/src/app/view/vm-manager/vm-manager.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import {Component, inject, OnDestroy, OnInit} from '@angular/core'; import {LogoComponent} from '../../common/components/logo/logo.component'; import {NullinsideService} from '../../service/nullinside.service'; import {MatIcon} from '@angular/material/icon';