mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
16 lines
481 B
TypeScript
16 lines
481 B
TypeScript
import { getAppDispatch } from '../../state/dispatch';
|
|
import { updateInviteContactModal } from '../../state/ducks/modalDialog';
|
|
import { useIsPublic } from '../../hooks/useParamSelector';
|
|
|
|
export function useShowInviteContactToCommunity(conversationId: string) {
|
|
const dispatch = getAppDispatch();
|
|
const isPublic = useIsPublic(conversationId);
|
|
const cb = () => dispatch(updateInviteContactModal({ conversationId }));
|
|
|
|
if (!isPublic) {
|
|
return null;
|
|
}
|
|
|
|
return cb;
|
|
}
|