@yogiswara/honcho-editor-ui 2.5.3 → 2.5.4
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.
|
@@ -124,7 +124,12 @@ export function useHonchoEditorBulk(controller, eventID, firebaseUid) {
|
|
|
124
124
|
setImageCollection(prev => [...prev, ...response.gallery]);
|
|
125
125
|
// track page & "more" status
|
|
126
126
|
setPage(response.current_page);
|
|
127
|
-
|
|
127
|
+
if (!response.next_page || response.gallery.length === 0) {
|
|
128
|
+
setHasMore(false);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
setHasMore(true);
|
|
132
|
+
}
|
|
128
133
|
}
|
|
129
134
|
catch (err) {
|
|
130
135
|
console.error("Failed to fetch image list:", err);
|
|
@@ -140,26 +145,26 @@ export function useHonchoEditorBulk(controller, eventID, firebaseUid) {
|
|
|
140
145
|
}
|
|
141
146
|
}, [isLoading, hasMore, page, loadImages]);
|
|
142
147
|
// Extract selected image IDs for other operations (like applying bulk adjustments)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
if (eventID && firebaseUid) {
|
|
150
|
+
setIsLoading(true);
|
|
151
|
+
setError(null);
|
|
152
|
+
controller.getImageList(firebaseUid, eventID, page + 1)
|
|
153
|
+
.then(response => {
|
|
154
|
+
// TODO need do pagination for this one
|
|
155
|
+
batchActions.syncAdjustment(response.gallery.map(mapToImageAdjustmentConfig));
|
|
156
|
+
setImageCollection(response.gallery);
|
|
157
|
+
})
|
|
158
|
+
.catch(err => {
|
|
159
|
+
console.error("Failed to fetch image list:", err);
|
|
160
|
+
setError("Could not load images.");
|
|
161
|
+
})
|
|
162
|
+
.finally(() => {
|
|
163
|
+
setIsLoading(false);
|
|
164
|
+
});
|
|
165
|
+
console.log("Image data FROM USEHONCHOBULK: ", imageData);
|
|
166
|
+
}
|
|
167
|
+
}, [eventID, firebaseUid, controller]);
|
|
163
168
|
useEffect(() => {
|
|
164
169
|
if (eventID && firebaseUid) {
|
|
165
170
|
setImageCollection([]); // reset when event changes
|