Fixed Twitch redemptions being stored when switching users. Added form valid check when clicking on save for redemptions.
This commit is contained in:
parent
59bed7c28b
commit
5a94aa760b
@ -100,6 +100,9 @@ export class RedemptionItemEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
if (this.formGroups.invalid)
|
||||
return;
|
||||
|
||||
this.responseError = undefined;
|
||||
const order = this.orderFormControl.value;
|
||||
if (order == null) {
|
||||
|
@ -3,14 +3,24 @@ import { inject, Injectable } from '@angular/core';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import TwitchRedemption from '../models/twitch-redemption';
|
||||
import { of } from 'rxjs';
|
||||
import EventService from './EventService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TwitchRedemptionService {
|
||||
private http = inject(HttpClient);
|
||||
private readonly http = inject(HttpClient);
|
||||
private readonly events = inject(EventService);
|
||||
private twitchRedemptions: TwitchRedemption[] = [];
|
||||
private loaded = false
|
||||
private loaded = false;
|
||||
|
||||
|
||||
constructor() {
|
||||
this.events.listen('logoff', () => {
|
||||
this.twitchRedemptions = [];
|
||||
this.loaded = false;
|
||||
});
|
||||
}
|
||||
|
||||
fetch(force: boolean = false) {
|
||||
if (!force && this.loaded)
|
||||
|
Loading…
x
Reference in New Issue
Block a user