mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
#23 fixed user detection at superpower
This commit is contained in:
parent
f792259dd5
commit
40f881fdad
1 changed files with 3 additions and 3 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue