Skip to content

Commit 2459769

Browse files
committed
Avoid duplicate pending image cards and bump version to v2.7.2
1 parent 1eaf851 commit 2459769

6 files changed

Lines changed: 11 additions & 7 deletions

File tree

desktop/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nano-banana-pro-frontend",
33
"private": true,
4-
"version": "2.7.1",
4+
"version": "2.7.2",
55
"license": "MIT",
66
"description": "大香蕉图片生成工具 - 批量图片生成应用前端",
77
"type": "module",

desktop/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "desktop"
3-
version = "2.7.1"
3+
version = "2.7.2"
44
description = "A Tauri App"
55
authors = ["you"]
66
edition = "2021"

desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "大香蕉 AI",
4-
"version": "2.7.1",
4+
"version": "2.7.2",
55
"identifier": "com.dztool.banana",
66
"build": {
77
"beforeDevCommand": "npm run dev",

desktop/src/utils/mapping.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export const mapBackendTaskToFrontend = (task: BackendTask): GenerationTask => {
99
const getFullUrl = (path: string | undefined, source?: BackendTask['image_source']) => {
1010
return getImageUrlFromSource(source, path || '');
1111
};
12+
const hasResolvedImage =
13+
Boolean(task.local_path || task.image_url || task.thumbnail_path || task.thumbnail_url);
1214

1315
const localizedErrorMessage = localizeErrorSummary(task).errorMessage;
1416
const rawErrorMessage = sanitizeBackendErrorMessage(task.error_message);
@@ -48,6 +50,8 @@ export const mapBackendTaskToFrontend = (task: BackendTask): GenerationTask => {
4850
thumbnailUrl: getFullUrl(task.thumbnail_path || task.local_path || task.thumbnail_url || task.image_url, task.thumbnail_source || task.image_source)
4951
};
5052

53+
const shouldExposeImages = hasResolvedImage || task.status === 'completed' || task.status === 'failed' || task.status === 'partial';
54+
5155
return {
5256
id: task.task_id,
5357
prompt: task.prompt,
@@ -68,7 +72,7 @@ export const mapBackendTaskToFrontend = (task: BackendTask): GenerationTask => {
6872
options: task.config_snapshot || '',
6973
createdAt: task.created_at,
7074
updatedAt: task.updated_at || '',
71-
images: [image]
75+
images: shouldExposeImages ? [image] : []
7276
};
7377
};
7478

0 commit comments

Comments
 (0)