Skip to content

Commit

Permalink
fix: wrong name profile when change wallet (#2218)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh authored Sep 6, 2023
1 parent 7c0906b commit dc8b0d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/Header/web3/SignWallet/ConfirmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dc8b0d4

Please sign in to comment.