Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { whenever } from '@vueuse/core'
import { computed, onMounted } from 'vue'
import { computed, nextTick, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'

import { useToastStore } from './toastStore'
Expand Down Expand Up @@ -65,9 +65,12 @@ export function useFrontendVersionMismatchWarning(
versionCompatibilityStore.dismissWarning()
}

onMounted(() => {
onMounted(async () => {
// Only set up the watcher if immediate is true
if (immediate) {
// Wait for next tick to ensure reactive updates from settings load have propagated
await nextTick()

whenever(
() => versionCompatibilityStore.shouldShowWarning,
() => {
Expand Down
11 changes: 8 additions & 3 deletions src/platform/updates/common/versionCompatibilityStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,16 @@ export const useVersionCompatibilityStore = defineStore(
return Date.now() < dismissedUntil
})

const warningsDisabled = computed(() =>
settingStore.get('Comfy.VersionCompatibility.DisableWarnings')
)

const shouldShowWarning = computed(() => {
const warningsDisabled = settingStore.get(
'Comfy.VersionCompatibility.DisableWarnings'
return (
hasVersionMismatch.value &&
!isDismissed.value &&
!warningsDisabled.value
)
return hasVersionMismatch.value && !isDismissed.value && !warningsDisabled
})

const warningMessage = computed(() => {
Expand Down
Loading