Skip to content

Commit

Permalink
feat: show pwa install screen after 15 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
gion-andri committed Dec 14, 2023
1 parent 9dbdbc6 commit 63dd5d1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 63dd5d1

Please sign in to comment.