Fix image gallery data mapping (#570)
Co-authored-by: Michael Chung <michaelchung@michaels-mbp-2.home>
This commit is contained in:
1 parent
8c192b17f1
commit
ca80275d28
2 files changed
+20
-2
No files matched your search
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Get the directory of this script
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Go up to the root of the repository (assumes src/app/pages is always 3 levels deep)
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
||||
|
||||
cd "${REPO_ROOT}"
|
||||
echo "${REPO_ROOT}"
|
||||
|
||||
|
||||
# Run the launch script
|
||||
./script/desktop/run_desktop_3d.sh
|
||||
@@ -128,13 +128,17 @@ export const GalleryModal = React.memo(
|
||||
user_uploads_only: activeTab === "uploads",
|
||||
});
|
||||
if (response.success && response.data) {
|
||||
// Print the JSON response for debugging
|
||||
console.log("Media files response:", response.data);
|
||||
|
||||
const newItems = response.data.map((item: any) => ({
|
||||
id: item.token,
|
||||
label: item.maybe_title || "Image Generation",
|
||||
thumbnail: item.thumbnail,
|
||||
fullImage: item.fullImage,
|
||||
thumbnail: item.media_links.maybe_thumbnail_template,
|
||||
fullImage: item.media_links.cdn_url,
|
||||
createdAt: item.created_at,
|
||||
}));
|
||||
console.log("Media files response:", newItems);
|
||||
setGroupedItems(groupItemsByDate(newItems));
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user