Skip to content

Commit 54342ac

Browse files
authored
fix(FlipClock): update digit after switch visible (#6473)
* refactor: 修复缓存导致数字不更新问题 * chore: bump version 9.8.2-beta05
1 parent fc34c3c commit 54342ac

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.8.2-beta04</Version>
4+
<Version>9.8.2-beta05</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/FlipClock/FlipClock.razor.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
return;
1313
}
1414

15-
const lastValues = {};
1615
let counter = 0;
1716
let totalMilliseconds = 0;
1817
let countDown = false;
@@ -73,13 +72,11 @@
7372
const d = getDate();
7473
const unitConfig = getConfig();
7574
unitConfig.forEach(({ key, list, digits }) => {
76-
if (list === null) return;
77-
78-
const v = d[key];
79-
if (lastValues[key] !== v) {
80-
lastValues[key] = v;
81-
setDigits(list, v, digits, countDown);
75+
if (list === null) {
76+
return;
8277
}
78+
79+
setDigits(list, d[key], digits, countDown);
8380
});
8481
return d;
8582
};

0 commit comments

Comments
 (0)