Fix: Selected assets count not updating in Imported tab (#6842)

## Summary
- Fix bug where the "Selected assets count" displayed as 0 in the
Imported tab when selecting assets

## Root Cause
The `getOutputCount` function was returning `0` when
`user_metadata.outputCount` was not present.

- **Generated tab**: Works correctly because `outputCount` metadata is
set during generation
- **Imported tab**: `outputCount` metadata is never set, so it always
returns `0` → selected count shows as 0

## Solution
Changed the default return value from `0` to `1` when `outputCount`
metadata is not present, ensuring every asset counts as at least 1.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
Jin Yi
2025-11-23 15:57:36 +07:00
committed by GitHub
parent 6d41e8b6e4
commit 09c888e338

View File

@@ -214,7 +214,7 @@ const shouldShowDeleteButton = computed(() => {
const getOutputCount = (item: AssetItem): number => {
const count = item.user_metadata?.outputCount
return typeof count === 'number' && count > 0 ? count : 0
return typeof count === 'number' && count > 0 ? count : 1
}
const shouldShowOutputCount = (item: AssetItem): boolean => {