fix: correct updateClusterAfterMerge to trigger computed update
Problem: - Previous commit tried to splice computed property (clusterAsPending) - Computed properties cannot be modified directly - Need to update underlying data (clusterResultsCache) Solution: - Remove incorrect clusterAsPending.value.splice() - Trigger reactive update via clusterResultsCache reassignment - clusterAsPending computed will auto-update Technical details: - Vue computed properties are read-only - Must modify underlying reactive data - Reassignment triggers computed recalculation
This commit is contained in:
@@ -1611,14 +1611,11 @@ function updateClusterAfterMerge(sourceGroupId: string, targetGroupId: string) {
|
|||||||
|
|
||||||
const idx = clusters.findIndex((c: any) => c.identity_uuid === sourceGroupId)
|
const idx = clusters.findIndex((c: any) => c.identity_uuid === sourceGroupId)
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
clusters.splice(idx, 1) // ← Remove empty source group
|
clusters.splice(idx, 1) // Remove empty source group from cache
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Trigger computed property update
|
||||||
// Also remove from clusterAsPending computed
|
clusterResultsCache.value = { ...clusterResultsCache.value }
|
||||||
const idx2 = clusterAsPending.value.findIndex((c: any) => c.identity_uuid === sourceGroupId)
|
|
||||||
if (idx2 >= 0) {
|
|
||||||
clusterAsPending.value.splice(idx2, 1)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user