generated from bisco/codex-bootstrap
fix: point check-in QR links to frontend page
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
@@ -326,6 +326,7 @@ type BarcodeDetectorConstructor = new (options?: { formats?: string[] }) => Barc
|
||||
export class CheckInPlaceholderPageComponent {
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
private readonly formBuilder = inject(FormBuilder);
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly showsApi = inject(ShowsApiService);
|
||||
private readonly barcodeDetectorCtor = (globalThis as { BarcodeDetector?: BarcodeDetectorConstructor }).BarcodeDetector;
|
||||
private readonly scannerSupported =
|
||||
@@ -358,6 +359,12 @@ export class CheckInPlaceholderPageComponent {
|
||||
|
||||
constructor() {
|
||||
this.destroyRef.onDestroy(() => this.stopScanner());
|
||||
const tokenFromQuery = this.route.snapshot.queryParamMap.get('token')?.trim() ?? '';
|
||||
if (tokenFromQuery) {
|
||||
this.tokenForm.controls.token.setValue(tokenFromQuery);
|
||||
this.tokenForm.controls.token.markAsTouched();
|
||||
this.preview();
|
||||
}
|
||||
}
|
||||
|
||||
protected preview(): void {
|
||||
|
||||
Reference in New Issue
Block a user