forked from jsnbuchanan/crowd-funder-for-time-pwa
add note to install as an app
This commit is contained in:
@@ -10,6 +10,21 @@
|
||||
|
||||
<!-- show the actions for recognizing a give -->
|
||||
<div class="mb-8">
|
||||
<div
|
||||
v-if="!isInstalled()"
|
||||
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
|
||||
>
|
||||
<p>
|
||||
You should install this as an app.
|
||||
<router-link
|
||||
:to="{ name: 'help-notifications' }"
|
||||
class="text-blue-500"
|
||||
>
|
||||
Go here for instructions.
|
||||
</router-link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!activeDid"
|
||||
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
|
||||
@@ -249,6 +264,18 @@ export default class HomeView extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
// from https://benborgers.com/posts/pwa-detect-installed
|
||||
isInstalled() {
|
||||
// For iOS
|
||||
if ("standalone" in window.navigator) return true;
|
||||
|
||||
// For Android
|
||||
if (window.matchMedia("(display-mode: standalone)").matches) return true;
|
||||
|
||||
// If neither is true, it's not installed
|
||||
return false;
|
||||
}
|
||||
|
||||
public async buildHeaders() {
|
||||
const headers: HeadersInit = {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user