@yogiswara/honcho-editor-ui 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -185,9 +185,12 @@ export function useHonchoEditor(controller, initImageId, firebaseUid, eventId) {
|
|
|
185
185
|
const items = response.gallery.map(g => ({
|
|
186
186
|
id: g.id,
|
|
187
187
|
url: g.raw_edited?.path || g.download?.path || '',
|
|
188
|
+
name: g.id,
|
|
188
189
|
file: new File([], g.id),
|
|
189
190
|
}));
|
|
190
191
|
setImageList(items);
|
|
192
|
+
// ✅ ADD THIS CONSOLE LOG
|
|
193
|
+
console.log("✅ Image list fetched and set in state:", items);
|
|
191
194
|
// ✅ SET INITIAL PAGINATION STATE
|
|
192
195
|
setCurrentPage(1);
|
|
193
196
|
setHasNextPage(response.next_page !== 0 && response.next_page > response.current_page);
|
|
@@ -396,6 +399,14 @@ export function useHonchoEditor(controller, initImageId, firebaseUid, eventId) {
|
|
|
396
399
|
// Dependencies: The external props and readiness flags that trigger this logic.
|
|
397
400
|
// Whenever any of these change, this effect will re-evaluate.
|
|
398
401
|
}, [initImageId, firebaseUid, controller, isEditorReady, loadImageFromId]);
|
|
402
|
+
useEffect(() => {
|
|
403
|
+
// Ensure we have everything needed before trying to load.
|
|
404
|
+
if (currentImageId && firebaseUid && controller && isEditorReady) {
|
|
405
|
+
console.log(`[EFFECT] currentImageId changed to: ${currentImageId}. Loading new image into canvas.`);
|
|
406
|
+
// Load the new image specified by the updated currentImageId
|
|
407
|
+
loadImageFromId(firebaseUid, currentImageId);
|
|
408
|
+
}
|
|
409
|
+
}, [currentImageId, isEditorReady]);
|
|
399
410
|
const handleFileChange = (event) => {
|
|
400
411
|
const files = event.target?.files;
|
|
401
412
|
if (!files || files.length === 0)
|