diff --git a/src/components/Header/web3/SignWallet/ConfirmModal.tsx b/src/components/Header/web3/SignWallet/ConfirmModal.tsx index aa5f792460..f14f4cecf7 100644 --- a/src/components/Header/web3/SignWallet/ConfirmModal.tsx +++ b/src/components/Header/web3/SignWallet/ConfirmModal.tsx @@ -38,7 +38,7 @@ const Highlight = styled.span` const ModalConfirmProfile: React.FC = () => { const theme = useTheme() - const isOpen = useSelector((state: AppState) => state.authen.showConfirmProfile) + const setConfirm = useSetConfirmChangeProfile() const [connectSuccess, setConnectSuccess] = useState(false) @@ -51,6 +51,10 @@ const ModalConfirmProfile: React.FC = () => { const navigate = useNavigate() const isMobile = useMedia(`(max-width: ${MEDIA_WIDTHS.upToExtraSmall}px)`) + const isOpen = + useSelector((state: AppState) => state.authen.showConfirmProfile) && + signedAccount?.toLowerCase?.() !== account?.toLowerCase?.() + useEffect(() => { if (!isOpen) setTimeout(() => { diff --git a/src/hooks/social.ts b/src/hooks/social.ts index 61ddefd4b6..a45d998ca7 100644 --- a/src/hooks/social.ts +++ b/src/hooks/social.ts @@ -15,8 +15,8 @@ export const useUploadImageToCloud = () => { try { const file = fileObject as File const ext = file.name?.split('.')?.pop() ?? '' - if (!IMAGE_ALLOW_EXTENSIONS.includes(ext) && file.name) throw new Error('File is not support') - const fileName = `${uuid() + Date.now()}.${ext}` + if (ext && !IMAGE_ALLOW_EXTENSIONS.includes(ext)) throw new Error('File is not support') + const fileName = `${uuid() + Date.now()}.${ext || 'png'}` const res = await uploadImage({ fileName, }).unwrap()