refacto: move size to computed values
All checks were successful
repod / xml (push) Successful in 17s
repod / php (push) Successful in 57s
repod / nodejs (push) Successful in 2m1s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-14 00:33:40 +01:00
parent 1c566b19cb
commit 6b6d21fa2f

View File

@ -22,7 +22,7 @@
<template #icon>
<Download :size="20" />
</template>
{{ t('repod', 'Download') }} {{ size ? `(${humanFileSize(size)})` : '' }}
{{ t('repod', 'Download') }} {{ size ? `(${episodeFileSize})` : '' }}
</NcButton>
</div>
</div>
@ -73,6 +73,9 @@ export default {
},
},
computed: {
episodeFileSize() {
return humanFileSize(this.size)
},
strippedDescription() {
const pre = document.createElement('pre')
pre.innerHTML = this.description
@ -80,9 +83,6 @@ export default {
return strippedDescription.replace(/\n/g, '<br>')
},
},
methods: {
humanFileSize,
},
}
</script>