Skip to content

Commit 20bd014

Browse files
chore: formatting
1 parent 55c3af8 commit 20bd014

File tree

12 files changed

+116
-116
lines changed

12 files changed

+116
-116
lines changed

src/src/app/common/components/logo/logo.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, inject } from '@angular/core';
1+
import {Component, inject, Input} from '@angular/core';
22
import {Router} from '@angular/router';
33

44
@Component({
@@ -7,8 +7,8 @@ import {Router} from '@angular/router';
77
templateUrl: './logo.component.html',
88
styleUrl: './logo.component.scss'
99
})
10-
export class LogoComponent {
11-
private router = inject(Router);
10+
export class LogoComponent {
11+
private router = inject(Router);
1212

1313
@Input() height: number = 50;
1414
@Input() fontSize: number = 35;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface OAuth {
2-
bearer: string,
3-
refresh: string,
4-
expiresUtc: string
2+
bearer: string,
3+
refresh: string,
4+
expiresUtc: string
55
}

src/src/app/service/nullinside-null.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable, inject } from '@angular/core';
1+
import {inject, Injectable} from '@angular/core';
22
import {Observable} from 'rxjs';
33
import {environment} from '../../environments/environment';
44
import {HttpClient} from '@angular/common/http';
@@ -7,8 +7,8 @@ import {ImdbSearch} from '../common/interface/imdb-search';
77
@Injectable({
88
providedIn: 'root'
99
})
10-
export class NullinsideNullService {
11-
private httpClient = inject(HttpClient);
10+
export class NullinsideNullService {
11+
private httpClient = inject(HttpClient);
1212

1313

1414
getImdbSearchQuick(search: string): Observable<ImdbSearch> {

src/src/app/service/nullinside-twitch-bot.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable, inject } from '@angular/core';
1+
import {inject, Injectable} from '@angular/core';
22
import {HttpClient} from "@angular/common/http";
33
import {Observable} from "rxjs";
44
import {environment} from "../../environments/environment";
@@ -8,8 +8,8 @@ import {TwitchBotConfig} from "../common/interface/twitch-bot-config";
88
@Injectable({
99
providedIn: 'root'
1010
})
11-
export class NullinsideTwitchBotService {
12-
private httpClient = inject(HttpClient);
11+
export class NullinsideTwitchBotService {
12+
private httpClient = inject(HttpClient);
1313

1414

1515
getIsMod(): Observable<TwitchBotIsModResponse> {

src/src/app/service/nullinside.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable, inject } from '@angular/core';
1+
import {inject, Injectable} from '@angular/core';
22
import {HttpClient} from "@angular/common/http";
33
import {Observable} from "rxjs";
44
import {environment} from "../../environments/environment";
@@ -9,8 +9,8 @@ import {FeatureToggleResponse} from "../common/interface/feature-toggle-response
99
@Injectable({
1010
providedIn: 'root'
1111
})
12-
export class NullinsideService {
13-
private httpClient = inject(HttpClient);
12+
export class NullinsideService {
13+
private httpClient = inject(HttpClient);
1414

1515

1616
validateToken(token: string): Observable<boolean> {

src/src/app/view/home/home.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, inject } from '@angular/core';
1+
import {Component, inject, OnInit} from '@angular/core';
22
import {NullinsideService} from "../../service/nullinside.service";
33
import {VM_ADMIN} from "../../common/constants";
44
import {WebsiteApp} from "../../common/interface/website-app";
@@ -17,9 +17,9 @@ import {UserRolesResponse} from "../../common/interface/user-roles-response";
1717
templateUrl: './home.component.html',
1818
styleUrl: './home.component.scss'
1919
})
20-
export class HomeComponent implements OnInit {
21-
private api = inject(NullinsideService);
22-
private router = inject(Router);
20+
export class HomeComponent implements OnInit {
21+
private api = inject(NullinsideService);
22+
private router = inject(Router);
2323

2424
public roles: string[] | null = null;
2525
public error: string | null = null;

src/src/app/view/imdb-search/imdb-search.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnDestroy, inject } from '@angular/core';
1+
import {Component, inject, OnDestroy} from '@angular/core';
22
import {LogoComponent} from '../../common/components/logo/logo.component';
33
import {NullinsideNullService} from '../../service/nullinside-null.service';
44
import {MatFormFieldModule} from '@angular/material/form-field';
@@ -20,8 +20,8 @@ import {ImdbSearchItems} from '../../common/interface/imdb-search';
2020
templateUrl: './imdb-search.component.html',
2121
styleUrl: './imdb-search.component.scss'
2222
})
23-
export class ImdbSearchComponent implements OnDestroy {
24-
private api = inject(NullinsideNullService);
23+
export class ImdbSearchComponent implements OnDestroy {
24+
private api = inject(NullinsideNullService);
2525

2626
searching: boolean = false;
2727
quickSubscription: Subscription | null = null;
Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, inject } from '@angular/core';
1+
import {Component, inject, OnInit} from '@angular/core';
22
import {ActivatedRoute, ParamMap} from "@angular/router";
33
import {Errors} from "../login-landing/errors";
44
import {HttpErrorResponse} from "@angular/common/http";
@@ -10,106 +10,106 @@ import {CdkCopyToClipboard} from "@angular/cdk/clipboard";
1010
import {interval, Subscription} from "rxjs";
1111

1212
@Component({
13-
selector: 'app-login-landing-desktop',
14-
imports: [
15-
LoadingIconComponent,
16-
LogoComponent,
17-
MatButton,
18-
CdkCopyToClipboard
19-
],
20-
templateUrl: './login-landing-desktop.component.html',
21-
styleUrl: './login-landing-desktop.component.scss'
13+
selector: 'app-login-landing-desktop',
14+
imports: [
15+
LoadingIconComponent,
16+
LogoComponent,
17+
MatButton,
18+
CdkCopyToClipboard
19+
],
20+
templateUrl: './login-landing-desktop.component.html',
21+
styleUrl: './login-landing-desktop.component.scss'
2222
})
2323
export class LoginLandingDesktopComponent implements OnInit {
24-
private route = inject(ActivatedRoute);
25-
private timer: Subscription | undefined;
26-
private desktopData: string | undefined;
24+
private route = inject(ActivatedRoute);
25+
private timer: Subscription | undefined;
26+
private desktopData: string | undefined;
2727

28-
loggedIn: boolean = false;
29-
error: string = '';
30-
oAuth: OAuth | null = null;
31-
loading: boolean = true;
28+
loggedIn: boolean = false;
29+
error: string = '';
30+
oAuth: OAuth | null = null;
31+
loading: boolean = true;
3232

33-
ngOnInit(): void {
34-
this.route.queryParamMap.subscribe({
35-
next: (params: ParamMap) => {
36-
const error = params.get('error');
37-
if (null !== error) {
38-
const errorNum = +error;
39-
if (Errors.TWITCH_ACCOUNT_HAS_NO_EMAIL === errorNum) {
40-
this.onLoginFailed('Your Twitch account must have a valid e-mail address, please add one and try again')
41-
} else if (Errors.TWITCH_ERROR_WITH_TOKEN === errorNum) {
42-
this.onLoginFailed('Twitch failed to give us a valid token, please try again')
43-
} else {
44-
this.onLoginFailed('Sorry we did something wrong trying to log you in, please try again')
45-
}
33+
ngOnInit(): void {
34+
this.route.queryParamMap.subscribe({
35+
next: (params: ParamMap) => {
36+
const error = params.get('error');
37+
if (null !== error) {
38+
const errorNum = +error;
39+
if (Errors.TWITCH_ACCOUNT_HAS_NO_EMAIL === errorNum) {
40+
this.onLoginFailed('Your Twitch account must have a valid e-mail address, please add one and try again')
41+
} else if (Errors.TWITCH_ERROR_WITH_TOKEN === errorNum) {
42+
this.onLoginFailed('Twitch failed to give us a valid token, please try again')
43+
} else {
44+
this.onLoginFailed('Sorry we did something wrong trying to log you in, please try again')
45+
}
4646

47-
return;
48-
}
47+
return;
48+
}
4949

50-
const oAuth = {
51-
bearer: params.get('bearer'),
52-
refresh: params.get('refresh'),
53-
expiresUtc: params.get('expiresUtc'),
54-
};
50+
const oAuth = {
51+
bearer: params.get('bearer'),
52+
refresh: params.get('refresh'),
53+
expiresUtc: params.get('expiresUtc'),
54+
};
5555

56-
if (null === oAuth.bearer || null === oAuth.refresh || null === oAuth.expiresUtc) {
57-
this.onLoginFailed();
58-
return;
59-
}
56+
if (null === oAuth.bearer || null === oAuth.refresh || null === oAuth.expiresUtc) {
57+
this.onLoginFailed();
58+
return;
59+
}
6060

61-
this.oAuth = {
62-
bearer: oAuth.bearer,
63-
refresh: oAuth.refresh,
64-
expiresUtc: oAuth.expiresUtc
65-
};
61+
this.oAuth = {
62+
bearer: oAuth.bearer,
63+
refresh: oAuth.refresh,
64+
expiresUtc: oAuth.expiresUtc
65+
};
6666

67-
// DO NOT assign this.desktopData until AFTER you update the clipboard successfully.
68-
// The absence of a value on this.desktopData is what tells the application we haven't logged in yet.
69-
const json = JSON.stringify(oAuth);
70-
navigator.clipboard.writeText(json);
71-
this.desktopData = json;
67+
// DO NOT assign this.desktopData until AFTER you update the clipboard successfully.
68+
// The absence of a value on this.desktopData is what tells the application we haven't logged in yet.
69+
const json = JSON.stringify(oAuth);
70+
navigator.clipboard.writeText(json);
71+
this.desktopData = json;
7272

73-
this.loading = false;
74-
this.timer = interval(1000)
75-
.subscribe({
76-
next: _ => {
77-
this.runCheckForLogin();
78-
},
79-
error: e => {
80-
console.error(e);
81-
}
82-
});
73+
this.loading = false;
74+
this.timer = interval(1000)
75+
.subscribe({
76+
next: _ => {
77+
this.runCheckForLogin();
8378
},
84-
error: (_: HttpErrorResponse) => {
85-
this.onLoginFailed();
79+
error: e => {
80+
console.error(e);
8681
}
87-
});
88-
}
82+
});
83+
},
84+
error: (_: HttpErrorResponse) => {
85+
this.onLoginFailed();
86+
}
87+
});
88+
}
8989

90-
private runCheckForLogin() {
91-
try {
92-
navigator.clipboard.readText().then(text => {
93-
// If the text matches what we put on the clipboard then we aren't signed in yet.
94-
if (undefined === this.desktopData || text === this.desktopData) {
95-
return;
96-
}
90+
private runCheckForLogin() {
91+
try {
92+
navigator.clipboard.readText().then(text => {
93+
// If the text matches what we put on the clipboard then we aren't signed in yet.
94+
if (undefined === this.desktopData || text === this.desktopData) {
95+
return;
96+
}
9797

98-
// If the text does match, we are signed in on the desktop app. Maybe...kinda....might be...you never know...
99-
// Don't judge me. -.-
100-
this.timer?.unsubscribe();
101-
this.loggedIn = true;
102-
})
103-
} catch {
104-
// Do nothing, just don't crash.
105-
}
98+
// If the text does match, we are signed in on the desktop app. Maybe...kinda....might be...you never know...
99+
// Don't judge me. -.-
100+
this.timer?.unsubscribe();
101+
this.loggedIn = true;
102+
})
103+
} catch {
104+
// Do nothing, just don't crash.
106105
}
106+
}
107107

108-
onLoginFailed(message = ':( Failed to login, please try again'): void {
109-
this.error = message;
110-
this.loading = false;
111-
}
108+
onLoginFailed(message = ':( Failed to login, please try again'): void {
109+
this.error = message;
110+
this.loading = false;
111+
}
112112

113-
protected readonly JSON = JSON;
114-
protected readonly window = window;
113+
protected readonly JSON = JSON;
114+
protected readonly window = window;
115115
}

src/src/app/view/login-landing/login-landing.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
1+
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
22
import {NullinsideService} from "../../service/nullinside.service";
33
import {LogoComponent} from "../../common/components/logo/logo.component";
44
import {LoadingIconComponent} from "../../common/components/loading-icon/loading-icon.component";

src/src/app/view/login/login.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, inject } from '@angular/core';
1+
import {Component, inject, OnInit} from '@angular/core';
22
import {LogoComponent} from "../../common/components/logo/logo.component";
33
import {environment} from "../../../environments/environment";
44
import {NullinsideService} from "../../service/nullinside.service";
@@ -17,10 +17,10 @@ import {TwitchLoginComponent} from '../../common/components/twitch-login/twitch-
1717
templateUrl: './login.component.html',
1818
styleUrl: './login.component.scss'
1919
})
20-
export class LoginComponent implements OnInit {
21-
private api = inject(NullinsideService);
22-
private router = inject(Router);
23-
private route = inject(ActivatedRoute);
20+
export class LoginComponent implements OnInit {
21+
private api = inject(NullinsideService);
22+
private router = inject(Router);
23+
private route = inject(ActivatedRoute);
2424

2525
loginUrl: string;
2626
checkingLogin = false;

0 commit comments

Comments
 (0)