From 63dd5d1360c49e7782048742d0b911b5d4d49461 Mon Sep 17 00:00:00 2001 From: Gion-Andri Cantieni Date: Thu, 14 Dec 2023 13:59:35 +0100 Subject: [PATCH] feat: show pwa install screen after 15 seconds --- src/app/app.component.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b54bc43..7c910dd 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -126,13 +126,17 @@ export class AppComponent implements OnInit { } private openPwaWindow(type: 'instructions_ios' | 'instructions_android_firefox' | 'direct') { - const modalRef = this.modalService.open(PwaInstallInstructionsComponent, {size: 'xl', centered: true}); - modalRef.componentInstance.type = type; - modalRef.closed.subscribe((value) => { - if (value === 'install') { - this.promptEvent.prompt(); - } - }); + const that = this; + + window.setTimeout(function () { + const modalRef = that.modalService.open(PwaInstallInstructionsComponent, {size: 'xl', centered: true}); + modalRef.componentInstance.type = type; + modalRef.closed.subscribe((value) => { + if (value === 'install') { + that.promptEvent.prompt(); + } + }); + }, 15000); } private checkIfThirdTimeAppOpened(): boolean {