add auth
This commit is contained in:
@@ -12,13 +12,13 @@ import { MatButton } from '@angular/material/button';
|
||||
import { Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { AuthPromptService } from '../../auth/auth-prompt.service';
|
||||
import { ClaimFlow } from '../../claim/claim-flow/claim-flow';
|
||||
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
||||
import { AudioGuide } from '../../shared/audio-guide/audio-guide';
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
import {
|
||||
GorodarActions,
|
||||
selectAuthenticated,
|
||||
selectClaim,
|
||||
selectCollectedAt,
|
||||
selectCollectedIdSet,
|
||||
@@ -37,7 +37,7 @@ export class MapItemPage {
|
||||
private readonly store = inject(Store);
|
||||
private readonly location = inject(Location);
|
||||
private readonly router = inject(Router);
|
||||
private readonly authPrompt = inject(AuthPromptService);
|
||||
private readonly authenticated = this.store.selectSignal(selectAuthenticated);
|
||||
|
||||
readonly id = input.required<string>();
|
||||
|
||||
@@ -95,13 +95,14 @@ export class MapItemPage {
|
||||
}
|
||||
|
||||
protected claimItem(): void {
|
||||
void this.authPrompt.prompt('claim').then((result) => {
|
||||
if (result !== 'authenticated') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.authenticated()) {
|
||||
this.store.dispatch(GorodarActions.takePhoto({ landmarkId: this.id() }));
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.store.dispatch(
|
||||
GorodarActions.authSheetOpened({ intent: 'claim', landmarkId: this.id() }),
|
||||
);
|
||||
}
|
||||
|
||||
protected openPhoto(): void {
|
||||
|
||||
Reference in New Issue
Block a user