mirror of
https://github.com/Spythere/genera-tor.git
synced 2026-05-04 14:08:13 +00:00
35 lines
677 B
Vue
35 lines
677 B
Vue
<template>
|
|
<div v-if="needRefresh" class="update-prompt" @click="updateServiceWorker(true)">
|
|
{{ $t('update.update-available-text') }}
|
|
<u>{{ $t('update.update-available-underline') }}</u>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useRegisterSW } from 'virtual:pwa-register/vue';
|
|
|
|
const { needRefresh, updateServiceWorker } = useRegisterSW({ immediate: true });
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@use '../../styles/colors';
|
|
|
|
.update-prompt {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
padding: 0.5em;
|
|
|
|
z-index: 200;
|
|
|
|
font-weight: bold;
|
|
|
|
text-align: center;
|
|
|
|
width: 100%;
|
|
background-color: colors.$accentCol;
|
|
|
|
cursor: pointer;
|
|
}
|
|
</style>
|