perf(files): less verbose

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/36534/head
John Molakvoæ 2023-03-25 12:01:02 +07:00
parent f28944e23f
commit bda286c7f0
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
2 changed files with 4 additions and 4 deletions

@ -346,7 +346,6 @@ export default Vue.extend({
// Check if we already have this preview cached // Check if we already have this preview cached
const isCached = await this.isCachedPreview(this.previewUrl) const isCached = await this.isCachedPreview(this.previewUrl)
if (isCached) { if (isCached) {
logger.debug('Preview already cached', { fileId: this.source.attributes.fileid, backgroundFailed: this.backgroundFailed })
this.backgroundImage = `url(${this.previewUrl})` this.backgroundImage = `url(${this.previewUrl})`
this.backgroundFailed = false this.backgroundFailed = false
return return
@ -357,14 +356,12 @@ export default Vue.extend({
}, },
fetchAndApplyPreview() { fetchAndApplyPreview() {
logger.debug('Fetching preview', { fileId: this.source.attributes.fileid })
this.img = new Image() this.img = new Image()
this.img.onload = () => { this.img.onload = () => {
this.backgroundImage = `url(${this.previewUrl})` this.backgroundImage = `url(${this.previewUrl})`
} }
this.img.onerror = (a, b, c) => { this.img.onerror = () => {
this.backgroundFailed = true this.backgroundFailed = true
logger.error('Failed to fetch preview', { fileId: this.source.attributes.fileid, a, b, c })
} }
this.img.src = this.previewUrl this.img.src = this.previewUrl
}, },

@ -172,6 +172,9 @@ module.exports = {
inlineWorkboxRuntime: true, inlineWorkboxRuntime: true,
sourcemap: false, sourcemap: false,
// Increase perfs with less logging
disableDevLogs: true,
// Define runtime caching rules. // Define runtime caching rules.
runtimeCaching: [{ runtimeCaching: [{
// Match any preview file request // Match any preview file request