🎨 (App) fullheight

This commit is contained in:
Julien Calixte
2019-11-23 10:48:17 +01:00
parent 5d55d15b44
commit 9d9ab393d9
3 changed files with 2 additions and 41 deletions

View File

@@ -1,37 +0,0 @@
<template>
<span class="install-app navbar-item" v-if="showInstall">
<span @click="prompt" class="install-button">installer</span>
</span>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import accountService from '@/services/AccountService'
@Component
export default class InstallApp extends Vue {
private showInstall: boolean = false
public mounted(): void {
window.addEventListener('beforeinstallprompt', async () => {
const accounts = await accountService.getAll(true)
this.showInstall = accounts.length > 0
})
}
public prompt(): void {
const pwaInstall = document.querySelector('pwa-install') as any
if (pwaInstall) {
pwaInstall.openPrompt()
}
}
}
</script>
<style scoped>
span.install-button {
font-weight: bold;
}
span.install-button:hover {
cursor: pointer;
}
</style>