|
|
@@ -119,10 +119,11 @@ const Statistics: React.FC<StatisticsProps> = () => {
|
|
|
// 下拉刷新:刷新所有统计数据
|
|
|
usePullDownRefresh(async () => {
|
|
|
try {
|
|
|
- // refetchQueries + type: 'all' 强制刷新所有统计查询(包括 inactive 的懒加载图表)
|
|
|
- await queryClient.refetchQueries({
|
|
|
+ // invalidateQueries + refetchType: 'all' 强制刷新所有查询(包括 inactive 的)
|
|
|
+ // refetchQueries 无法刷新 disabled (enabled: false) 的查询
|
|
|
+ await queryClient.invalidateQueries({
|
|
|
queryKey: ['statistics'],
|
|
|
- type: 'all' // 刷新所有匹配的查询,包括 inactive 的
|
|
|
+ refetchType: 'all' // 刷新所有匹配的查询,包括 inactive 的
|
|
|
})
|
|
|
} finally {
|
|
|
Taro.stopPullDownRefresh()
|