Skip to content

Commit

Permalink
fix(mux-uploader): Fix default format progress to include percent sym…
Browse files Browse the repository at this point in the history
…bol. Move to module fn.
  • Loading branch information
cjpillsbury committed Jul 8, 2022
1 parent 96b563e commit 6f519f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/mux-uploader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -319,7 +321,6 @@ class MuxUploaderElement extends HTMLElement {
}

get formatProgress(): (percent: number) => string {
const defaultFormatProgress = (percent: number) => `${Math.floor(percent)}`;
return this._formatProgress ?? defaultFormatProgress;
}

Expand Down

0 comments on commit 6f519f7

Please sign in to comment.