feat(setting): 由于 gif 使用 canvas 裁剪后无法保留动图格式,对 gif 格式的头像文件跳过裁剪处理。

没有添加确认的步骤。个人感觉从用户体验上来说,直接设置成功会更好一些。

issue #7
pull/13/head
shikelong 4 years ago
parent abb3d939e9
commit 702ff7596e

@ -33,9 +33,7 @@ export const AvatarPicker: React.FC<AvatarPickerProps> = React.memo((props) => {
if (isGIF(pickedFile)) {
updateAvatar(URL.createObjectURL(pickedFile));
return;
}
} else {
const reader = new FileReader();
reader.addEventListener('load', () => {
if (reader.result) {
@ -57,6 +55,7 @@ export const AvatarPicker: React.FC<AvatarPickerProps> = React.memo((props) => {
}
});
reader.readAsDataURL(pickedFile);
}
// 清理选中状态
e.target.files = null;

Loading…
Cancel
Save