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.
session-desktop/ts/hooks/useWeAreAdmin.ts

15 lines
371 B
TypeScript

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