mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 09:48:44 +00:00
fixed new users having no audio clips in account bug.
This commit is contained in:
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]);
|
||||
|
||||
Reference in new issue
Block a user