best-unit 2.0.15 → 2.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/best-unit.cjs +10 -10
- package/dist/best-unit.js +278 -278
- package/package.json +1 -1
- package/src/components/business/statistical-balance/index.tsx +5 -1
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ function StatisticalBalance(props: { popoverPosition?: PopoverPosition }) {
|
|
|
31
31
|
currency: "USD",
|
|
32
32
|
details: [],
|
|
33
33
|
});
|
|
34
|
+
const [loading, setLoading] = useState(true);
|
|
34
35
|
|
|
35
36
|
const fetchBalance = async () => {
|
|
36
37
|
try {
|
|
@@ -81,9 +82,10 @@ function StatisticalBalance(props: { popoverPosition?: PopoverPosition }) {
|
|
|
81
82
|
};
|
|
82
83
|
|
|
83
84
|
setBalanceData(newBalanceData);
|
|
85
|
+
setLoading(false);
|
|
84
86
|
} catch (err) {
|
|
85
87
|
console.error("获取余额失败:", err);
|
|
86
|
-
//
|
|
88
|
+
setLoading(false); // 即使失败也允许渲染(可按需做兜底)
|
|
87
89
|
}
|
|
88
90
|
};
|
|
89
91
|
|
|
@@ -152,6 +154,8 @@ function StatisticalBalance(props: { popoverPosition?: PopoverPosition }) {
|
|
|
152
154
|
},
|
|
153
155
|
];
|
|
154
156
|
|
|
157
|
+
if (loading) return null;
|
|
158
|
+
|
|
155
159
|
return (
|
|
156
160
|
<HoverPopover
|
|
157
161
|
popover={
|