From 50ae2b601e30b69aea8bd3251a34c5542103185c Mon Sep 17 00:00:00 2001 From: nikolay Date: Wed, 21 Jun 2023 11:41:50 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#14384=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20WPA=20?= =?UTF-8?q?=D0=9A=D0=BE=D1=84=D0=B5=D0=9B=D0=B0=D0=B9=D0=BA:=20fix=20insta?= =?UTF-8?q?ll=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angular/src/app/directives/download-app.directive.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/angular/src/app/directives/download-app.directive.ts b/angular/src/app/directives/download-app.directive.ts index d569494..fd31670 100644 --- a/angular/src/app/directives/download-app.directive.ts +++ b/angular/src/app/directives/download-app.directive.ts @@ -37,6 +37,9 @@ export class DownloadAppDirective implements OnInit { if (this.deviceType === 'ios') { this.el.nativeElement.style.display = 'block'; } + if (window.matchMedia('(display-mode: standalone)').matches) { + this.el.nativeElement.style.display = 'none'; + } } @HostListener('window:beforeinstallprompt', ['$event']) @@ -53,7 +56,7 @@ export class DownloadAppDirective implements OnInit { // Prevent Chrome 67 and earlier from automatically showing the prompt e.preventDefault(); // Stash the event so it can be triggered later. - this.deferredPrompt = e; + this.deferredPrompt = e; this.el.nativeElement.style.display = 'none'; }