dev #14384 Правка ошибок отображения WPA КофеЛайк: fix install button

This commit is contained in:
nikolay 2023-06-21 11:41:50 +04:00
parent 798ec5e21a
commit 50ae2b601e

View File

@ -37,6 +37,9 @@ export class DownloadAppDirective implements OnInit {
if (this.deviceType === 'ios') { if (this.deviceType === 'ios') {
this.el.nativeElement.style.display = 'block'; this.el.nativeElement.style.display = 'block';
} }
if (window.matchMedia('(display-mode: standalone)').matches) {
this.el.nativeElement.style.display = 'none';
}
} }
@HostListener('window:beforeinstallprompt', ['$event']) @HostListener('window:beforeinstallprompt', ['$event'])
@ -53,7 +56,7 @@ export class DownloadAppDirective implements OnInit {
// Prevent Chrome 67 and earlier from automatically showing the prompt // Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault(); e.preventDefault();
// Stash the event so it can be triggered later. // Stash the event so it can be triggered later.
this.deferredPrompt = e; this.deferredPrompt = e;
this.el.nativeElement.style.display = 'none'; this.el.nativeElement.style.display = 'none';
} }