Skip to content

Commit

Permalink
fix beforeCrop logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nanxiaobei committed Nov 6, 2023
1 parent 56e09fd commit db0e629
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ImgCrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ const ImgCrop = forwardRef<CropperRef, ImgCropProps>((props, cropperRef) => {
try {
const result = await cb.current.beforeCrop(file, fileList);
if (result !== true) {
return resolve(result);
return resolve(file);
}
} catch (err) {
return resolve(err as BeforeUploadReturnType);
return resolve(file);
}
}

Expand Down

0 comments on commit db0e629

Please sign in to comment.