Implement clearing caches in settings

This commit is contained in:
tusooa 2024-08-23 00:31:03 -04:00
commit e21bac3d70
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
5 changed files with 50 additions and 4 deletions

View file

@ -3,6 +3,7 @@
import { storage } from 'src/lib/storage.js'
import { parseNotification } from './services/entity_normalizer/entity_normalizer.service.js'
import { prepareNotificationObject } from './services/notification_utils/notification_utils.js'
import { shouldCache, cacheKey, emojiCacheKey } from './services/sw/sw.js'
import { createI18n } from 'vue-i18n'
// Collects all messages for service workers
// Needed because service workers cannot use dynamic imports
@ -85,10 +86,7 @@ const showPushNotification = async (event) => {
return Promise.resolve()
}
const shouldCache = process.env.NODE_ENV === 'production'
const cacheKey = 'pleroma-fe'
const cacheFiles = self.serviceWorkerOption.assets
const emojiCacheKey = 'pleroma-fe-emoji'
const isEmoji = req => {
if (req.method !== 'GET') {
return false