mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't display PWA banner when using native app
This commit is contained in:
@@ -42,11 +42,15 @@ export default Ember.Component.extend({
|
||||
|
||||
@computed("deferredInstallPromptEvent", "bannerDismissed")
|
||||
showPWAInstallBanner() {
|
||||
const launchedFromDiscourseHub =
|
||||
window.location.search.indexOf("discourse_app=1") !== -1;
|
||||
|
||||
return (
|
||||
this.capabilities.isAndroid &&
|
||||
this.get("currentUser.trust_level") > 0 &&
|
||||
this.deferredInstallPromptEvent && // Pass the browser engagement checks
|
||||
!window.matchMedia("(display-mode: standalone)").matches && // Not be in the installed PWA already
|
||||
!launchedFromDiscourseHub && // not launched via official app
|
||||
!this.bannerDismissed // Have not a previously dismissed install banner
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user