Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsiungw committed May 15, 2024
1 parent c9fedcf commit fb637c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/client/src/app/profile/[[...slug]]/_block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react';
import { useFormState } from 'react-dom';
import { useRouter } from 'next/navigation';
import update from 'immutability-helper';
import { isArray, mergeWith, set } from 'lodash';
import { cloneDeep, isArray, mergeWith, set } from 'lodash';
import { useAppSelector, useAppDispatch } from '@/lib/store/hooks';
import { openAuthModal } from '@/lib/store/features/auth-modal/authModalSlice';
import { updateProfile } from '@/lib/actions/profile';
Expand Down Expand Up @@ -69,7 +69,8 @@ export default function ProfileEditBlock({
}, [profileId, router]);

useEffect(() => {
const storageProfile = getStorageProfile(); if (storageProfile) {
const storageProfile = getStorageProfile();
if (storageProfile) {
setProfile(() =>
update(
{},
Expand Down Expand Up @@ -101,7 +102,7 @@ export default function ProfileEditBlock({
}, [state]);

const handleFormChange = async e => {
const newState = { ...profile };
const newState = cloneDeep(profile);

if (e.target.id === 'avatarFile') {
const { width, height } = await getImageDimension(
Expand Down

0 comments on commit fb637c0

Please sign in to comment.