Skip to content

Commit a23160e

Browse files
李钿李钿
authored andcommitted
优化 callhandleEnd 如果不存在 isCalledHandleStart 则不需要调用 handleEnd 函数
1 parent e9072d9 commit a23160e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/ImageContainer.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,11 @@ class ImageContainer extends PureComponent {
242242
}
243243

244244
callHandleEnd = () =>{
245-
this.isCalledHandleStart = false;
246-
if(this.props.handleEnd){
247-
this.props.handleEnd();
245+
if(this.isCalledHandleStart){
246+
this.isCalledHandleStart = false;
247+
if(this.props.handleEnd){
248+
this.props.handleEnd();
249+
}
248250
}
249251
}
250252

0 commit comments

Comments
 (0)