fix for user instruements and genres are not been loaded on edit profile page load
This commit is contained in:
parent
cd1930a2bc
commit
fa35930c75
|
|
@ -113,7 +113,8 @@ function JKEditProfile() {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (instrumentsInitialLoadingDone || musicInstruments.length === 0 || userMusicInstruments.length === 0) return;
|
||||
if (instrumentsInitialLoadingDone || musicInstruments.length === 0) return;
|
||||
|
||||
const updatedMusicInstruments = musicInstruments.map(musicInstrument => {
|
||||
const instrument = getValues('instruments').find(instrument => instrument.instrument_id === musicInstrument.id);
|
||||
|
||||
|
|
@ -150,7 +151,7 @@ function JKEditProfile() {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (genreInitialLoadingDone || userGenres.length === 0 || genres.length === 0) return;
|
||||
if (genreInitialLoadingDone || genres.length === 0) return;
|
||||
|
||||
const updatedGenres = genres.map(genre => {
|
||||
const userGenre = userGenres.find(userGenre => userGenre.genre_id === genre.id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue