diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d5b8318..a0aa6c9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,7 +7,7 @@ import { ActivatedRoute, Router } from "@angular/router"; import { filter, map, takeUntil } from "rxjs/operators"; import { ToastService } from "./toast.service"; import { VoiceService } from "./services/voice.service"; -import { Subject } from "rxjs"; +import {delay, delayWhen, Subject} from "rxjs"; import { getAudioPath } from "./helper/tts.helper"; import {animate, keyframes, style, transition, trigger} from "@angular/animations"; import {environment} from "../environments/environment"; @@ -53,9 +53,8 @@ export class AppComponent implements OnInit, OnDestroy { console.log(data); this.eventService.emit(data); }); - this.apiService.getAppState('main').subscribe((result) => { - if(this.router.url.indexOf('admin') === -1) { - console.log(this.router.url); + this.apiService.getAppState('main').pipe(takeUntil(this.destroyed),delay(300)).subscribe((result) => { + if(this.router.url.indexOf('admin') === -1 || window.location.href.indexOf('admin') === -1) { this.router.navigate([`/${result.value}`]).then(() => { console.log(`navigated to ${result.value}`); }) diff --git a/src/app/components/answer-notification/answer-notification.component.html b/src/app/components/answer-notification/answer-notification.component.html index 5474eca..e9ceced 100644 --- a/src/app/components/answer-notification/answer-notification.component.html +++ b/src/app/components/answer-notification/answer-notification.component.html @@ -3,7 +3,7 @@
Запрещает игроку давать ответы в следующих двух раундах
+Запрещает игроку давать ответы в случайном количестве раундов