fixed new users having no audio clips in account bug.

This commit is contained in:
Quicksticks-oss committed 2024-04-11 00:47:10 -04:00
1 parent 60229c1da5
commit 2be22b0334
1 file changed
+1 -1
@@ -36,7 +36,6 @@ export const AudioTabComponent = () => {
const handleListAudioByUser = useCallback((username:string)=>{
setState((curr)=>({...curr, fetchingUserAudio:true}));
ListAudioByUser(username).then((res:any[])=>{
console.log(res)
setState((curr)=>({...curr, fetchingUserAudio:false}));
audioItemsFromServer.value = res.map(item=>{
const morphedItem:MediaItem = {
@@ -59,6 +58,7 @@ export const AudioTabComponent = () => {
if ( authState.userInfo ){
if(state.firstLoad === false && audioItemsFromServer.value.length === 0){
handleListAudioByUser(authState.userInfo.username);
setState((curr)=>({...curr, firstLoad:true}));
}
}
}, [authState, state, handleListAudioByUser]);