Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ import { routes } from './app.routes';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
import { BearerTokenInterceptor } from "./middleware/bearer-token-interceptor";
import {MAT_SNACK_BAR_DEFAULT_OPTIONS} from "@angular/material/snack-bar";

export const noopInterceptorProvider: Provider =
{provide: HTTP_INTERCEPTORS, useClass: BearerTokenInterceptor, multi: true};

export const materialSnackbarDefaults: Provider =
{provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: {duration: 5 * 1000}};

export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
provideAnimationsAsync(),
provideHttpClient(withInterceptorsFromDi()),
noopInterceptorProvider,
materialSnackbarDefaults
]
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export class TwitchBotConfigComponent implements OnInit, OnDestroy {
if (this.timerId !== -1) {
clearTimeout(this.timerId);
}

// Close any open notifications when we move to a different screen.
this.snackBar.dismiss();
}

ngOnInit(): void {
Expand All @@ -62,9 +65,9 @@ export class TwitchBotConfigComponent implements OnInit, OnDestroy {
if (Errors.TwitchAccountHasNoEmail === errorNum) {
this.onLoginFailed('Your Twitch account must have a valid e-mail address, please add one and try again', false)
} else if (Errors.TwitchErrorWithToken === errorNum) {
this.onLoginFailed('Twitch failed to give us a valid token, please add one and try again', false)
this.onLoginFailed('Twitch failed to log you in successfully, please try again', false)
} else {
this.onLoginFailed('Sorry we did something wrong trying to log you in, please add one and try again', false)
this.onLoginFailed('Sorry we did something wrong trying to log you in, please try again', false)
}

return;
Expand Down Expand Up @@ -167,7 +170,7 @@ export class TwitchBotConfigComponent implements OnInit, OnDestroy {
},
error: err => {
console.error(err);
this.snackBar.open('Failed to save config, please try again...', undefined, {
this.snackBar.open('Failed to save, please try again', undefined, {
panelClass: ['snackbar-failure']
});
}
Expand Down