1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

#23 fixed user detection at superpower

This commit is contained in:
Fedor Katurov 2021-03-19 18:04:36 +07:00
parent f792259dd5
commit 40f881fdad

View file

@ -4,13 +4,13 @@ import { selectAuthIsTester, selectUser } from '~/redux/auth/selectors';
interface IProps {}
const Superpower: FC<IProps> = memo(({ children }) => {
const Superpower: FC<IProps> = ({ children }) => {
const user = useShallowSelect(selectUser);
const is_tester = useShallowSelect(selectAuthIsTester);
if (!user || !is_tester) return null;
if (!user.is_user || !is_tester) return null;
return <>{children}</>;
});
};
export { Superpower };