aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index 1cbaa752..19c531af 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -331,19 +331,12 @@ const controls = {
if (type !== 'volume') {
progress.appendChild(createElement('span', null, '0'));
- let suffix = '';
- switch (type) {
- case 'played':
- suffix = i18n.get('played', this.config);
- break;
-
- case 'buffer':
- suffix = i18n.get('buffered', this.config);
- break;
+ const suffixKey = ({
+ played: 'played',
+ buffer: 'buffered',
+ })[type];
- default:
- break;
- }
+ const suffix = suffixKey ? i18n.get(suffixKey, this.config) : '';
progress.innerText = `% ${suffix.toLowerCase()}`;
}