File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' react-image-previewer ' : patch
3+ ---
4+
5+ fix: init scale & loading state
Original file line number Diff line number Diff line change @@ -449,10 +449,6 @@ export default function PhotoBox({
449449 }
450450 } , [ isActive ] )
451451
452- useIsomorphicLayoutEffect ( ( ) => {
453- expose ( { loading : ! loaded } )
454- } , [ loaded ] )
455-
456452 function handlePhotoLoad ( params : IPhotoLoadedParams ) {
457453 const state = params . loaded
458454 ? getSuitableImageSize (
@@ -462,7 +458,8 @@ export default function PhotoBox({
462458 rotate ,
463459 )
464460 : { }
465- if ( isDragMode && params . loaded ) expose ( { scale : state . scale as number } )
461+ if ( isDragMode && params . loaded && isActive )
462+ expose ( { scale : state . scale as number , loading : false } )
466463 updateState ( {
467464 ...params ,
468465 ...state ,
You can’t perform that action at this time.
0 commit comments