mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-23 07:50:15 +00:00
Fix node badge on unknown color palette (#1487)
* Fix node badge on unknown color palette * Update test expectations [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import { LGraphBadge } from '@comfyorg/litegraph'
|
||||
import _ from 'lodash'
|
||||
import { NodeBadgeMode } from '@/types/nodeSource'
|
||||
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
|
||||
import type { Palette } from '@/types/colorPalette'
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
const nodeSourceBadgeMode = computed(
|
||||
@@ -35,7 +36,7 @@ watch([nodeSourceBadgeMode, nodeIdBadgeMode, nodeLifeCycleBadgeMode], () => {
|
||||
app.graph?.setDirtyCanvas(true, true)
|
||||
})
|
||||
|
||||
const colorPalette = computed(() =>
|
||||
const colorPalette = computed<Palette | undefined>(() =>
|
||||
getColorPalette(settingStore.get('Comfy.ColorPalette'))
|
||||
)
|
||||
|
||||
@@ -78,10 +79,10 @@ onMounted(() => {
|
||||
}
|
||||
),
|
||||
fgColor:
|
||||
colorPalette.value.colors.litegraph_base?.BADGE_FG_COLOR ||
|
||||
colorPalette.value?.colors?.litegraph_base?.BADGE_FG_COLOR ||
|
||||
defaultColorPalette.colors.litegraph_base.BADGE_FG_COLOR,
|
||||
bgColor:
|
||||
colorPalette.value.colors.litegraph_base?.BADGE_BG_COLOR ||
|
||||
colorPalette.value?.colors?.litegraph_base?.BADGE_BG_COLOR ||
|
||||
defaultColorPalette.colors.litegraph_base.BADGE_BG_COLOR
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user