mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
Add console logs for debugging image editor functionality
Adds console logs to the image editor page in the client to aid in debugging issues related to media selection and URL generation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: cc48d98e-8c7e-4d95-835d-8e33b87c8532 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/JgqpaNl
This commit is contained in:
1 parent
225e4f2292
commit
7ee9b74a95
1 file changed
+7
-1
@@ -114,6 +114,8 @@ export default function ImageEditor() {
|
||||
|
||||
// Generate Cloudinary transformation URL
|
||||
useEffect(() => {
|
||||
console.log("[ImageEditor] useEffect triggered, selectedMedia:", selectedMedia);
|
||||
|
||||
if (!selectedMedia) {
|
||||
setPreviewUrl("");
|
||||
return;
|
||||
@@ -121,6 +123,7 @@ export default function ImageEditor() {
|
||||
|
||||
// Start with base image URL
|
||||
let url = selectedMedia.originalUrl;
|
||||
console.log("[ImageEditor] Generating preview URL from:", url);
|
||||
|
||||
// Extract Cloudinary parts
|
||||
const cloudinaryPattern = /https:\/\/res\.cloudinary\.com\/([^\/]+)\/image\/upload\//;
|
||||
@@ -297,7 +300,10 @@ export default function ImageEditor() {
|
||||
className={`relative cursor-pointer rounded-lg overflow-hidden border-2 transition-all ${
|
||||
selectedMedia?.id === media.id ? 'border-primary ring-2 ring-primary' : 'border-border hover:border-primary/50'
|
||||
}`}
|
||||
onClick={() => setSelectedMedia(media)}
|
||||
onClick={() => {
|
||||
console.log("[ImageEditor] Thumbnail clicked, media:", media);
|
||||
setSelectedMedia(media);
|
||||
}}
|
||||
data-testid={`select-image-${media.id}`}
|
||||
>
|
||||
<img
|
||||
|
||||
Reference in new issue
Block a user