fix: race condition on frq when newly logged in
This commit is contained in:
		
							parent
							
								
									671c45085d
								
							
						
					
					
						commit
						389f8dcaff
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		|  | @ -30,7 +30,6 @@ | |||
|     const VERSION = APP_VERSION; | ||||
|     const COMMIT = APP_COMMIT; | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     const dispatch = createEventDispatcher(); | ||||
| 
 | ||||
|     function gotoProfile() { | ||||
|  | @ -63,9 +62,13 @@ | |||
|         goto("/"); | ||||
|     } | ||||
| 
 | ||||
|     onMount(async () => { | ||||
|         await fetchFollowRequests(true) | ||||
|     }) | ||||
|     // fetch follow requests | ||||
|     let frqsFetched = false; | ||||
|      | ||||
|     $: if($account && !frqsFetched) { | ||||
|         fetchFollowRequests(true); | ||||
|         frqsFetched = true; | ||||
|     } | ||||
| </script> | ||||
| 
 | ||||
| <div id="navigation"> | ||||
|  | @ -98,7 +101,7 @@ | |||
|                 </span> | ||||
|             {/if} | ||||
|         </Button> | ||||
|         {#if $followRequests.length > 0} | ||||
|         {#if $followRequests && $followRequests.length > 0} | ||||
|             <Button label="{lang.string('navigation.follow_requests')}" | ||||
|                     href="/follow-requests"} | ||||
|                     active={$page.url.pathname === "/follow-requests"}> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue