fix for user instruements and genres are not been loaded on edit profile page load

This commit is contained in:
Nuwan 2024-09-10 19:28:44 +05:30
parent cd1930a2bc
commit fa35930c75
1 changed files with 3 additions and 2 deletions

View File

@ -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);