fix(frontend): 修复UI改进分支中的关键问题
- 修复RedeemView订阅刷新失败导致流程中断的问题 将订阅刷新隔离到独立try/catch,失败时仅显示警告 - 修复DataTable resize事件监听器泄漏问题 确保添加和移除使用同一个回调引用 - 修复订阅状态缓存导致强制刷新失效的问题 force=true时绕过activePromise缓存,clear()清空缓存 - 修复图表主题切换后颜色不更新的问题 添加图表ref并在主题切换时调用update()方法
This commit is contained in:
@@ -48,7 +48,7 @@ export const useSubscriptionStore = defineStore('subscriptions', () => {
|
||||
}
|
||||
|
||||
// Return in-flight request if exists (deduplication)
|
||||
if (activePromise) {
|
||||
if (activePromise && !force) {
|
||||
return activePromise
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export const useSubscriptionStore = defineStore('subscriptions', () => {
|
||||
|
||||
// Start new request
|
||||
loading.value = true
|
||||
activePromise = subscriptionsAPI
|
||||
const requestPromise = subscriptionsAPI
|
||||
.getActiveSubscriptions()
|
||||
.then((data) => {
|
||||
if (currentGeneration === requestGeneration) {
|
||||
@@ -71,10 +71,14 @@ export const useSubscriptionStore = defineStore('subscriptions', () => {
|
||||
throw error
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
activePromise = null
|
||||
if (activePromise === requestPromise) {
|
||||
loading.value = false
|
||||
activePromise = null
|
||||
}
|
||||
})
|
||||
|
||||
activePromise = requestPromise
|
||||
|
||||
return activePromise
|
||||
}
|
||||
|
||||
@@ -106,6 +110,7 @@ export const useSubscriptionStore = defineStore('subscriptions', () => {
|
||||
*/
|
||||
function clear() {
|
||||
requestGeneration++
|
||||
activePromise = null
|
||||
activeSubscriptions.value = []
|
||||
loaded.value = false
|
||||
lastFetchedAt.value = null
|
||||
|
||||
Reference in New Issue
Block a user