Skip to content

Commit 6ebb7fc

Browse files
committed
refactor: 修复给常量赋值错误
1 parent bbb0d8f commit 6ebb7fc

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/components/BootstrapBlazor.PdfReader/PdfReader.razor.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ const loadPdf = async pdf => {
139139

140140
if (bar) {
141141
const val = loaded / total * 100;
142-
if (val > 100) {
143-
val = 100;
144-
}
145-
bar.style.setProperty('--bb-view-progress-val', `${val}%`);
142+
bar.style.setProperty('--bb-view-progress-val', `${Math.min(val, 100)}%`);
146143

147144
if (progressHandler === null) {
148145
progressHandler = setTimeout(() => {

0 commit comments

Comments
 (0)