From 6f519f7335c62b031781d9d68de4aadab39b2089 Mon Sep 17 00:00:00 2001 From: Christian Pillsbury Date: Fri, 8 Jul 2022 07:33:22 -0500 Subject: [PATCH] fix(mux-uploader): Fix default format progress to include percent symbol. Move to module fn. --- packages/mux-uploader/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mux-uploader/src/index.ts b/packages/mux-uploader/src/index.ts index 2852d5d27..7a02a894c 100644 --- a/packages/mux-uploader/src/index.ts +++ b/packages/mux-uploader/src/index.ts @@ -210,6 +210,8 @@ const TYPES = { RADIAL: 'radial', }; +const defaultFormatProgress = (percent: number) => `${Math.floor(percent)}%`; + const getRadius = (el: MuxUploaderElement) => Number(el.svgCircle?.getAttribute('r')); const getCircumference = (el: MuxUploaderElement) => getRadius(el) * 2 * Math.PI; @@ -319,7 +321,6 @@ class MuxUploaderElement extends HTMLElement { } get formatProgress(): (percent: number) => string { - const defaultFormatProgress = (percent: number) => `${Math.floor(percent)}`; return this._formatProgress ?? defaultFormatProgress; }