@yogiswara/honcho-editor-ui 1.4.5 → 1.4.7
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.
|
@@ -298,7 +298,6 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
298
298
|
const file = new File([blob], filename, { type: blob.type });
|
|
299
299
|
await editorRef.current.loadImageFromFile(file);
|
|
300
300
|
setIsImageLoaded(true);
|
|
301
|
-
updateCanvasEditor();
|
|
302
301
|
}
|
|
303
302
|
catch (error) {
|
|
304
303
|
console.error(error);
|
|
@@ -662,11 +661,11 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
662
661
|
}, [galleryImageData, editorRef.current]);
|
|
663
662
|
useEffect(() => {
|
|
664
663
|
// Render photo if adjustmentState change;
|
|
665
|
-
if (!editorRef.current)
|
|
664
|
+
if (!editorRef.current || !isImageLoaded)
|
|
666
665
|
return;
|
|
667
666
|
editorRef.current.setAdjustments(mapAdjustmentStateToAdjustmentEditor(currentAdjustmentsState));
|
|
668
667
|
updateCanvasEditor();
|
|
669
|
-
}, [editorRef.current, currentAdjustmentsState]);
|
|
668
|
+
}, [editorRef.current, currentAdjustmentsState, isImageLoaded]);
|
|
670
669
|
useEffect(() => {
|
|
671
670
|
window.addEventListener('keydown', handleKeyDown);
|
|
672
671
|
return () => {
|