mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
[fix] Fix conflict red dot not syncing
between components Resolve reactivity issue by sharing useStorage refs across all composable instances to ensure UI consistency.
This commit is contained in:
@@ -80,13 +80,13 @@ const { isVisible: isHelpCenterVisible } = storeToRefs(helpCenterStore)
|
|||||||
const { shouldShowRedDot: showReleaseRedDot } = storeToRefs(releaseStore)
|
const { shouldShowRedDot: showReleaseRedDot } = storeToRefs(releaseStore)
|
||||||
|
|
||||||
const conflictDetection = useConflictDetection()
|
const conflictDetection = useConflictDetection()
|
||||||
const conflictAcknowledgment = useConflictAcknowledgment()
|
|
||||||
|
|
||||||
const { showNodeConflictDialog } = useDialogService()
|
const { showNodeConflictDialog } = useDialogService()
|
||||||
|
|
||||||
// Use conflict acknowledgment state from composable
|
// Use conflict acknowledgment state from composable - call only once
|
||||||
const { shouldShowRedDot: shouldShowConflictRedDot, markConflictsAsSeen } =
|
const { shouldShowRedDot: shouldShowConflictRedDot, markConflictsAsSeen } =
|
||||||
conflictAcknowledgment
|
useConflictAcknowledgment()
|
||||||
|
|
||||||
// Use either release red dot or conflict red dot
|
// Use either release red dot or conflict red dot
|
||||||
const shouldShowRedDot = computed(() => {
|
const shouldShowRedDot = computed(() => {
|
||||||
const releaseRedDot = showReleaseRedDot
|
const releaseRedDot = showReleaseRedDot
|
||||||
|
|||||||
@@ -21,6 +21,17 @@ interface ConflictAcknowledgmentState {
|
|||||||
warning_banner_dismissed: boolean
|
warning_banner_dismissed: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shared state - initialized once and reused across all composable calls
|
||||||
|
const modalDismissed = useStorage(STORAGE_KEYS.CONFLICT_MODAL_DISMISSED, false)
|
||||||
|
const redDotDismissed = useStorage(
|
||||||
|
STORAGE_KEYS.CONFLICT_RED_DOT_DISMISSED,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
const warningBannerDismissed = useStorage(
|
||||||
|
STORAGE_KEYS.CONFLICT_WARNING_BANNER_DISMISSED,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composable for managing conflict acknowledgment state in localStorage
|
* Composable for managing conflict acknowledgment state in localStorage
|
||||||
*
|
*
|
||||||
@@ -33,20 +44,6 @@ interface ConflictAcknowledgmentState {
|
|||||||
export function useConflictAcknowledgment() {
|
export function useConflictAcknowledgment() {
|
||||||
const conflictDetectionStore = useConflictDetectionStore()
|
const conflictDetectionStore = useConflictDetectionStore()
|
||||||
|
|
||||||
// Reactive state using VueUse's useStorage for automatic persistence
|
|
||||||
const modalDismissed = useStorage(
|
|
||||||
STORAGE_KEYS.CONFLICT_MODAL_DISMISSED,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const redDotDismissed = useStorage(
|
|
||||||
STORAGE_KEYS.CONFLICT_RED_DOT_DISMISSED,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
const warningBannerDismissed = useStorage(
|
|
||||||
STORAGE_KEYS.CONFLICT_WARNING_BANNER_DISMISSED,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create computed state object for backward compatibility
|
// Create computed state object for backward compatibility
|
||||||
const state = computed<ConflictAcknowledgmentState>(() => ({
|
const state = computed<ConflictAcknowledgmentState>(() => ({
|
||||||
modal_dismissed: modalDismissed.value,
|
modal_dismissed: modalDismissed.value,
|
||||||
@@ -82,7 +79,8 @@ export function useConflictAcknowledgment() {
|
|||||||
const shouldShowConflictModal = computed(() => !modalDismissed.value)
|
const shouldShowConflictModal = computed(() => !modalDismissed.value)
|
||||||
const shouldShowRedDot = computed(() => {
|
const shouldShowRedDot = computed(() => {
|
||||||
if (!hasConflicts.value) return false
|
if (!hasConflicts.value) return false
|
||||||
return !redDotDismissed.value
|
if (redDotDismissed.value) return false
|
||||||
|
return true
|
||||||
})
|
})
|
||||||
const shouldShowManagerBanner = computed(() => {
|
const shouldShowManagerBanner = computed(() => {
|
||||||
return hasConflicts.value && !warningBannerDismissed.value
|
return hasConflicts.value && !warningBannerDismissed.value
|
||||||
|
|||||||
@@ -454,9 +454,6 @@ export function useConflictDetection() {
|
|||||||
importFailInfo: Record<string, { msg: string; name: string; path: string }>
|
importFailInfo: Record<string, { msg: string; name: string; path: string }>
|
||||||
): ConflictDetectionResult[] {
|
): ConflictDetectionResult[] {
|
||||||
const results: ConflictDetectionResult[] = []
|
const results: ConflictDetectionResult[] = []
|
||||||
|
|
||||||
console.log('@@@', importFailInfo)
|
|
||||||
|
|
||||||
if (!importFailInfo || typeof importFailInfo !== 'object') {
|
if (!importFailInfo || typeof importFailInfo !== 'object') {
|
||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user