edit profile page: fixing genres and instrument loading issue

This commit is contained in:
Nuwan 2024-09-18 03:12:51 +05:30
parent 3695b2f5d4
commit 3300b5a37a
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ function JKEditProfile() {
});
useEffect(() => {
if (!userProfile) return;
if (!userProfile || Object.keys(userProfile).length === 0) return;
updateFormData(userProfile);
setUserGenres(userProfile.genres);
setUserMusicInstruments(userProfile.instruments);
@ -114,7 +114,7 @@ function JKEditProfile() {
useEffect(() => {
if (instrumentsInitialLoadingDone || musicInstruments.length === 0) return;
const updatedMusicInstruments = musicInstruments.map(musicInstrument => {
const instrument = getValues('instruments').find(instrument => instrument.instrument_id === musicInstrument.id);