Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FixaMinGata] Hide app badges when using PWABuilder #5311

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/web/fixamingata/footer_extra.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="mysoc-footer__site-name">FixaMinGata</h2>
<p>Rapportera eller visa lokala problem. Var som helst i Sverige.</p>
</div>

<div class="fms-app-badges">
<div class="fms-app-badges" style="display: none;">
<a class="js-lazyload fms-app-badge fms-app-badge--ios" href="http://appstore.com/fixamingata">
FixaMinGata på App Store
</a>
Expand Down
10 changes: 10 additions & 0 deletions web/cobrands/fixamingata/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ if (window.$) {
fixmystreet.fixChromeAutocomplete
);
}

// Show the app badges if the app is not a PWABuilder progressive web app from
// the iOS App Store.
if (document.cookie.indexOf("app-platform=iOS App Store") === -1) {
var fmsAppBadges = document.getElementsByClassName("fms-app-badges")[0];

if (fmsAppBadges) {
fmsAppBadges.style.display = "block";
}
}
Loading