fix
This commit is contained in:
@@ -420,7 +420,7 @@ const reusePrompt = (gen) => {
|
||||
}
|
||||
|
||||
const reuseAsset = (gen) => {
|
||||
const assetIds = gen.assets || gen.input_assets || []
|
||||
const assetIds = gen.assets_list || gen.input_assets || []
|
||||
|
||||
if (assetIds && assetIds.length > 0) {
|
||||
selectedAssets.value = assetIds.map(id => {
|
||||
|
||||
@@ -363,30 +363,9 @@ 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) => {
|
||||
// Try to find input assets field from history object
|
||||
// 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) {
|
||||
selectedAssets.value = assetIds.map(id => {
|
||||
@@ -404,9 +383,9 @@ const reuseAsset = (gen) => {
|
||||
} else {
|
||||
console.warn("No linked/input assets found in history object:", gen)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const useResultAsReference = (gen) => {
|
||||
const useResultAsReference = (gen) => {
|
||||
if (gen.assets_list && gen.assets_list.length > 0) {
|
||||
// Appends the generated assets to the selection
|
||||
const newAssets = gen.assets_list.map(id => ({
|
||||
@@ -422,23 +401,23 @@ const reuseAsset = (gen) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Utils ---
|
||||
// --- Utils ---
|
||||
|
||||
const copyToClipboard = () => {
|
||||
const copyToClipboard = () => {
|
||||
// Implement if needed for prompt copying
|
||||
}
|
||||
}
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem('auth_code')
|
||||
router.push('/login')
|
||||
}
|
||||
}
|
||||
|
||||
// --- Lifecycle ---
|
||||
onMounted(() => {
|
||||
// --- Lifecycle ---
|
||||
onMounted(() => {
|
||||
loadHistory()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user