@yogiswara/honcho-editor-ui 1.3.3 → 1.3.5
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.
|
@@ -292,6 +292,7 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
292
292
|
}
|
|
293
293
|
}, [controller, loadImageFromUrl]);
|
|
294
294
|
const handlePrev = useCallback(async (firebaseUid) => {
|
|
295
|
+
console.log("[DEBUG] handlePrev function was called.");
|
|
295
296
|
// Find the current image index
|
|
296
297
|
const currentIndex = imageList.findIndex(img => img.id === currentImageId);
|
|
297
298
|
// If not the first image, go to previous
|
|
@@ -303,6 +304,7 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
303
304
|
}
|
|
304
305
|
}, [imageList, currentImageId]);
|
|
305
306
|
const handleNext = useCallback(async (firebaseUid) => {
|
|
307
|
+
console.log("[DEBUG] handleNext function was called.");
|
|
306
308
|
const currentIndex = imageList.findIndex(img => img.id === currentImageId);
|
|
307
309
|
// Condition 1: We are at the last image of the currently loaded list.
|
|
308
310
|
if (currentIndex === imageList.length - 1) {
|
|
@@ -374,12 +376,19 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
374
376
|
}, [initImageId, firebaseUid, controller, isEditorReady, loadImageFromId]);
|
|
375
377
|
useEffect(() => {
|
|
376
378
|
const initialize = async () => {
|
|
377
|
-
// 1. Check if we have the initial data and the editor is ready
|
|
378
379
|
if (initImageId && firebaseUid && controller && isEditorReady) {
|
|
379
380
|
console.log(`[INIT] Starting sequence for image: ${initImageId}`);
|
|
380
|
-
// 2. Load the initial image data and get the gallery object back
|
|
381
381
|
const initialGallery = await loadImageFromId(firebaseUid, initImageId);
|
|
382
|
-
//
|
|
382
|
+
// ✅ ADD THIS BLOCK TO CHECK THE DATA
|
|
383
|
+
console.group("[DEBUG] Checking Initial Gallery Data");
|
|
384
|
+
if (initialGallery) {
|
|
385
|
+
console.log("Full gallery object received:", initialGallery);
|
|
386
|
+
console.log("Discovered eventId from data:", initialGallery.event_id);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
console.error("Failed to fetch the initial gallery object.");
|
|
390
|
+
}
|
|
391
|
+
console.groupEnd();
|
|
383
392
|
if (initialGallery && initialGallery.event_id) {
|
|
384
393
|
const fetchedEventId = initialGallery.event_id;
|
|
385
394
|
console.log(`[INIT] Discovered eventID: ${fetchedEventId}`);
|