chore: offline mode improvements; changed to CacheFirst strategy

This commit is contained in:
2026-03-22 14:10:27 +01:00
parent eae62a8064
commit 89b6361a1c
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" /> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" /> <meta name="msapplication-TileColor" content="#da532c" />
<link rel="icon" href="favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/fa/css/fontawesome.css" /> <link rel="stylesheet" href="/fa/css/fontawesome.css" />
<link rel="stylesheet" href="/fa/css/brands.css" /> <link rel="stylesheet" href="/fa/css/brands.css" />
+1
View File
@@ -78,6 +78,7 @@ export const useApiStore = defineStore('apiStore', {
}, },
async fetchActiveData() { async fetchActiveData() {
if (this.dataStatuses.connection == Status.Data.Offline) return;
if (!this.activeData) this.dataStatuses.connection = Status.Data.Loading; if (!this.activeData) this.dataStatuses.connection = Status.Data.Loading;
try { try {
+1 -1
View File
@@ -29,7 +29,7 @@ export default defineConfig({
{ {
urlPattern: urlPattern:
/^https:\/\/stacjownik.spythere.eu\/api\/(getVehiclesData|getDonators|getSceneries)/i, /^https:\/\/stacjownik.spythere.eu\/api\/(getVehiclesData|getDonators|getSceneries)/i,
handler: 'NetworkFirst', handler: 'CacheFirst',
options: { options: {
cacheName: 'stacjownik-api-cache', cacheName: 'stacjownik-api-cache',
cacheableResponse: { statuses: [0, 200] } cacheableResponse: { statuses: [0, 200] }