diff --git a/package.json b/package.json index 9ceb932..5ab7aa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.15.0", + "version": "1.15.1", "private": true, "scripts": { "dev": "vite", diff --git a/src/main.ts b/src/main.ts index b29c074..ba5aebc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,6 @@ import plLang from './locales/pl.json'; import { createI18n } from 'vue-i18n'; import { createPinia } from 'pinia'; -import { registerSW } from 'virtual:pwa-register'; const i18n = createI18n({ locale: 'pl', @@ -21,15 +20,6 @@ const i18n = createI18n({ enableLegacy: false, }); -registerSW({ - onRegistered(r) { - r && - setInterval(() => { - r.update(); - }, 60 * 60 * 1000); - }, -}); - const clickOutsideDirective: Directive = { mounted(el, binding) { el.clickOutsideEvent = (event: Event) => { diff --git a/src/styles/badge.scss b/src/styles/badge.scss index 45dc2e3..3148bbf 100644 --- a/src/styles/badge.scss +++ b/src/styles/badge.scss @@ -65,12 +65,16 @@ &.twr { background-color: var(--clr-twr); - box-shadow: 0 0 5px 1px var(--clr-twr); + box-shadow: 0 0 5px 1px var(--clr-twr); color: black; } &.skr { background-color: var(--clr-skr); - box-shadow: 0 0 5px 1px var(--clr-skr); + box-shadow: 0 0 5px 1px var(--clr-skr); + } + + &.offline { + background-color: #be3728; } } diff --git a/vite.config.ts b/vite.config.ts index 44c3e28..d69430c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,55 +1,55 @@ -import { defineConfig } from 'vite'; -import vue from '@vitejs/plugin-vue'; -import { VitePWA } from 'vite-plugin-pwa'; - -export default defineConfig({ - server: { - port: 5001, - }, - plugins: [ - vue(), - VitePWA({ - registerType: 'prompt', - - workbox: { - globPatterns: ['**/*.{js,css,html,png,svg,jpg}'], - runtimeCaching: [ - { - urlPattern: new RegExp('^https://spythere.pl/api/getSceneries', 'i'), - handler: 'NetworkFirst', - options: { - cacheName: 'sceneries-cache', - expiration: { - maxEntries: 1, - maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days - }, - cacheableResponse: { - statuses: [0, 200], - }, - }, - }, - { - urlPattern: /^https:\/\/rj.td2.info.pl\/dist\/img\/thumbnails\/.*/i, - handler: 'CacheFirst', - options: { - cacheName: 'images-cache', - expiration: { - maxEntries: 100, - maxAgeSeconds: 60 * 60 * 24 * 60, - }, - cacheableResponse: { - statuses: [0, 200, 404], - }, - }, - }, - ], - }, - devOptions: { - enabled: true, - }, - }), - ], -}); - - - +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import { VitePWA } from 'vite-plugin-pwa'; + +export default defineConfig({ + server: { + port: 5001, + }, + plugins: [ + vue(), + VitePWA({ + registerType: 'autoUpdate', + + workbox: { + globPatterns: ['**/*.{js,css,html,png,svg,jpg}'], + runtimeCaching: [ + { + urlPattern: new RegExp('^https://spythere.pl/api/getSceneries', 'i'), + handler: 'NetworkFirst', + options: { + cacheName: 'sceneries-cache', + expiration: { + maxEntries: 1, + maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, + }, + { + urlPattern: /^https:\/\/rj.td2.info.pl\/dist\/img\/thumbnails\/.*/i, + handler: 'CacheFirst', + options: { + cacheName: 'images-cache', + expiration: { + maxEntries: 100, + maxAgeSeconds: 60 * 60 * 24 * 60, + }, + cacheableResponse: { + statuses: [0, 200, 404], + }, + }, + }, + ], + }, + devOptions: { + enabled: true, + }, + }), + ], +}); + + +