mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
[backport core/1.37] fix: version mismatch warning appearing in Playwright tests despite DisableWarnings setting (#8038)
Backport of #8036 to `core/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8038-backport-core-1-37-fix-version-mismatch-warning-appearing-in-Playwright-tests-despite--2e86d73d3650818c81bacf39eeb54e13) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
@@ -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'
|
||||
@@ -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,
|
||||
() => {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user