mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: address CodeRabbit review comments
- Add early return in updateAssetInCache when cacheKey resolves to undefined - Fix test to use mapped node type to properly validate array cache behavior Amp-Thread-ID: https://ampcode.com/threads/T-019c0bac-2144-73cb-a8d5-45146d0c2db9 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -507,12 +507,13 @@ export const useAssetsStore = defineStore('assets', () => {
|
||||
cacheKey?: string
|
||||
) {
|
||||
const category = cacheKey ? resolveCategory(cacheKey) : undefined
|
||||
if (cacheKey && !category) return
|
||||
|
||||
const categoriesToCheck = category
|
||||
? [category]
|
||||
: Array.from(modelStateByCategory.value.keys())
|
||||
|
||||
for (const cat of categoriesToCheck) {
|
||||
if (!cat) continue
|
||||
const state = modelStateByCategory.value.get(cat)
|
||||
if (!state?.assets) continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user