Add inactivity timeout and polling control to seat overlay
Introduces user inactivity tracking and timeout for seat polling in TheaterOverlayComponent. Polling is paused after 2 minutes of inactivity or when the user advances past step 1, with a snackbar notification and resume option. Refactors polling logic, adds step change event to OrderComponent, and updates custom theme for snackbar styling.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { SelectedSeatsService } from './../selected-seats.service';
|
||||
import { LoadingService } from './../loading.service';
|
||||
import { Bestellung, Eintrittskarte, Sitzkategorie, Sitzplatz, Vorstellung } from '@infinimotion/model-frontend';
|
||||
import { Component, computed, DestroyRef, inject, input, signal } from '@angular/core';
|
||||
import { Component, computed, DestroyRef, EventEmitter, inject, input, output, Output, signal, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { StepperSelectionEvent } from '@angular/cdk/stepper';
|
||||
import { HttpService } from '../http.service';
|
||||
@@ -29,12 +29,15 @@ export class OrderComponent {
|
||||
private fb = inject(FormBuilder);
|
||||
private httpService = inject(HttpService);
|
||||
private destroyRef = inject(DestroyRef);
|
||||
|
||||
readonly loadingService = inject(LoadingService);
|
||||
readonly selectedSeatsService = inject(SelectedSeatsService);
|
||||
|
||||
performance = input<Vorstellung>();
|
||||
seatCategories = input.required<Sitzkategorie[]>();
|
||||
|
||||
stepChanged = output<number>();
|
||||
|
||||
paymentForm!: FormGroup;
|
||||
dataForm!: FormGroup;
|
||||
|
||||
@@ -107,6 +110,8 @@ export class OrderComponent {
|
||||
onStepChange(event: StepperSelectionEvent) {
|
||||
this.submitted.set(false);
|
||||
this.selectedSeatsService.setSeatSelectable(event.selectedIndex === 0);
|
||||
|
||||
this.stepChanged.emit(event.selectedIndex);
|
||||
}
|
||||
|
||||
reservationClicked() {
|
||||
|
||||
Reference in New Issue
Block a user