selectedSeatsList should now be reset before loading theater. 🦏

This commit is contained in:
Marcel-Anker
2025-11-13 17:23:40 +01:00
parent c0f022e65c
commit 43e29e644d
2 changed files with 9 additions and 1 deletions

View File

@@ -27,4 +27,10 @@ export class SelectedSeatsService {
return this.selectedSeatsList;
}
clearSelectedSeatsList(): void {
this.selectedSeatsList.forEach((seat) => {
this.removeSelectedSeat(seat);
})
}
}

View File

@@ -5,6 +5,7 @@ import {catchError, of, tap} from 'rxjs';
import {Sitzplatz} from '@infinimotion/model-frontend';
import {TheaterSeatState} from '../model/theater-seat-state.model';
import {ActivatedRoute} from '@angular/router';
import {SelectedSeatsService} from '../selected-seats.service';
@Component({
selector: 'app-theater-overlay',
@@ -19,11 +20,12 @@ export class TheaterOverlayComponent implements OnInit {
showId!: number;
seatsPerRow: { seat: Sitzplatz, state: TheaterSeatState }[][] = []
constructor(private route: ActivatedRoute) {}
constructor(private route: ActivatedRoute, private selectedSeatService : SelectedSeatsService) {}
ngOnInit() {
this.showId = Number(this.route.snapshot.paramMap.get('id')!);
this.loadShowSeats();
this.selectedSeatService.clearSelectedSeatsList();
}
loadShowSeats() {