Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong name profile when change wallet #2218

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading