Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubito committed Jun 26, 2023
2 parents fb430f5 + 133bd38 commit 7d11ddd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/sagas/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const REQUEST_WORKERS_COUNT = 6
/**
* Loading bar animation duration in milliseconds
*/
const LOADING_ANIMATION = 350
const LOADING_ANIMATION = 400

/**
* How much percentage of overall progress is assigned to base sync when extra data fetch is enabled
Expand Down
21 changes: 7 additions & 14 deletions src/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ worker.addEventListener('message', (event) => {
})

worker.addEventListener('activate', (event) => {
event.waitUntil(Promise.all([caches.delete('images'), caches.delete('spotify-images')]))
event.waitUntil(
Promise.all([
caches.delete('images'),
caches.delete('spotify-images'),
caches.delete('spotify-api'),
])
)
})

// Cache font awesome assets
Expand Down Expand Up @@ -96,16 +102,3 @@ registerRoute(
],
})
)

// Cache artists album data
registerRoute(
/https:\/\/api\.spotify\.com\/v1\/artists\/.{22}\/albums/,
new CacheFirst({
cacheName: 'spotify-api',
plugins: [
new ExpirationPlugin({
maxAgeSeconds: 60 * 60,
}),
],
})
)

0 comments on commit 7d11ddd

Please sign in to comment.