mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-02 21:08:12 +00:00
chore: offline mode improvements; changed to CacheFirst strategy
This commit is contained in:
+1
-1
@@ -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" />
|
||||||
|
|||||||
@@ -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
@@ -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] }
|
||||||
|
|||||||
Reference in New Issue
Block a user