This commit is contained in:
xds
2026-02-06 18:53:12 +03:00
parent e510b7ae69
commit e2c0d46de8
2 changed files with 47 additions and 68 deletions

View File

@@ -420,7 +420,7 @@ const reusePrompt = (gen) => {
} }
const reuseAsset = (gen) => { const reuseAsset = (gen) => {
const assetIds = gen.assets || gen.input_assets || [] const assetIds = gen.assets_list || gen.input_assets || []
if (assetIds && assetIds.length > 0) { if (assetIds && assetIds.length > 0) {
selectedAssets.value = assetIds.map(id => { selectedAssets.value = assetIds.map(id => {

View File

@@ -362,31 +362,10 @@ const reusePrompt = (gen) => {
} }
} }
const reuseAsset = (gen) => {
// Assuming 'assets_list' from history are the generated assets,
// we need to check if there is a field for INPUT assets.
// If we want to reuse the assets that were USED to generate this image:
// We need to look for that field.
// IF the user means "Reuse the ASSET resulting from the generation", that is 'useResultAsReference'.
// IF the user means "Reuse the ASSETS that were INPUTS", we need to find them.
// Let's assume 'linked_assets' might be available or we use 'assets_list' if it's input-based?
// Based on `handleGenerate`, payload uses `assets_list` as INPUT IDs.
// The history response `assets_list` usually contains the IDs of the GENERATED assets (outputs).
// Let's check `gen` structure. Since I cannot see the full backend response structure here,
// I will assume there might be `input_assets` or similar.
// If not available, we might fallback or if the user meant "Reuse this generated image as an asset".
// Waiting for clarification on "Reuse Asset" (input) vs "Use Result" (output).
// The prompt says: "2) reuse asset (binds associated asset)", "3) use result (binds result as reference)".
// So (2) implies INPUT assets.
// Attempt to access input assets if available, otherwise warn or try to fetch.
// NOTE: In many systems, the input assets are stored in metadata.
const reuseAsset = (gen) => { const reuseAsset = (gen) => {
// Try to find input assets field from history object // Try to find input assets field from history object
// We check linked_assets or input_assets, and fallback to empty array if not found // We check linked_assets or input_assets, and fallback to empty array if not found
const assetIds = gen.linked_assets || gen.input_assets || [] const assetIds = gen.assets_list || gen.input_assets || []
if (assetIds && assetIds.length > 0) { if (assetIds && assetIds.length > 0) {
selectedAssets.value = assetIds.map(id => { selectedAssets.value = assetIds.map(id => {