[System Pop Up] Add setting to disable version update notifications (#4388)

This commit is contained in:
bmcomfy
2025-07-08 14:43:11 -07:00
committed by GitHub
parent 2906ea3fd9
commit d6f6407c44
7 changed files with 441 additions and 5 deletions

View File

@@ -32,6 +32,9 @@ export const useReleaseStore = defineStore('release', () => {
const releaseTimestamp = computed(() =>
settingStore.get('Comfy.Release.Timestamp')
)
const showVersionUpdates = computed(() =>
settingStore.get('Comfy.Notification.ShowVersionUpdates')
)
// Most recent release
const recentRelease = computed(() => {
@@ -73,6 +76,11 @@ export const useReleaseStore = defineStore('release', () => {
// Show toast if needed
const shouldShowToast = computed(() => {
// Skip if notifications are disabled
if (!showVersionUpdates.value) {
return false
}
if (!isNewVersionAvailable.value) {
return false
}
@@ -85,7 +93,7 @@ export const useReleaseStore = defineStore('release', () => {
// Skip if user already skipped or changelog seen
if (
releaseVersion.value === recentRelease.value?.version &&
!['skipped', 'changelog seen'].includes(releaseStatus.value)
['skipped', 'changelog seen'].includes(releaseStatus.value)
) {
return false
}
@@ -95,6 +103,11 @@ export const useReleaseStore = defineStore('release', () => {
// Show red-dot indicator
const shouldShowRedDot = computed(() => {
// Skip if notifications are disabled
if (!showVersionUpdates.value) {
return false
}
// Already latest → no dot
if (!isNewVersionAvailable.value) {
return false
@@ -132,6 +145,11 @@ export const useReleaseStore = defineStore('release', () => {
// Show "What's New" popup
const shouldShowPopup = computed(() => {
// Skip if notifications are disabled
if (!showVersionUpdates.value) {
return false
}
if (!isLatestVersion.value) {
return false
}
@@ -183,7 +201,14 @@ export const useReleaseStore = defineStore('release', () => {
// Fetch releases from API
async function fetchReleases(): Promise<void> {
if (isLoading.value) return
if (isLoading.value) {
return
}
// Skip fetching if notifications are disabled
if (!showVersionUpdates.value) {
return
}
isLoading.value = true
error.value = null