diff --git a/src/renderer/src/components/Popups/UserPopup.tsx b/src/renderer/src/components/Popups/UserPopup.tsx index 8b858ce7..410857e3 100644 --- a/src/renderer/src/components/Popups/UserPopup.tsx +++ b/src/renderer/src/components/Popups/UserPopup.tsx @@ -49,14 +49,18 @@ const PopupContainer: React.FC = ({ resolve }) => {
{}} - accept="image/png, image/jpeg" + accept="image/png, image/jpeg, image/gif" itemRender={() => null} maxCount={1} onChange={async ({ file }) => { try { const _file = file.originFileObj as File - const compressedFile = await compressImage(_file) - await ImageStorage.set('avatar', compressedFile) + if (_file.type === 'image/gif') { + await ImageStorage.set('avatar', _file) + } else { + const compressedFile = await compressImage(_file) + await ImageStorage.set('avatar', compressedFile) + } dispatch(setAvatar(await ImageStorage.get('avatar'))) } catch (error: any) { window.message.error(error.message)