You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			15 lines
		
	
	
		
			371 B
		
	
	
	
		
			TypeScript
		
	
		
		
			
		
	
	
			15 lines
		
	
	
		
			371 B
		
	
	
	
		
			TypeScript
		
	
| 
											4 years ago
										 | import { useSelector } from 'react-redux'; | ||
|  | import { StateType } from '../state/reducer'; | ||
|  | 
 | ||
|  | export const useWeAreAdmin = (convoId?: string) => | ||
|  |   useSelector((state: StateType) => { | ||
|  |     if (!convoId) { | ||
|  |       return false; | ||
|  |     } | ||
|  |     const convo = state.conversations.conversationLookup[convoId]; | ||
|  |     if (!convo) { | ||
|  |       return false; | ||
|  |     } | ||
|  |     return convo.weAreAdmin; | ||
|  |   }); |