File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* eslint-disable react/destructuring-assignment */
22import { connect } from 'react-redux' ;
3- import { useEffect , useRef } from 'react' ;
4- import { boxStyle , boxStyleDark } from '~ /styles' ;
5- import hasPermission from '~ /utils/permissions' ;
3+ import { useEffect , useRef , useState } from 'react' ;
4+ import { boxStyle , boxStyleDark } from '../.. /styles' ;
5+ import hasPermission from '../.. /utils/permissions' ;
66import { SEARCH , CREATE_NEW_TEAM } from '../../languages/en/ui' ;
77import styles from './TeamTableSearchPanel.module.css' ;
8-
98/**
109 * The search panel stateless component for Teams grid
1110 */
1211export function TeamTableSearchPanelBase ( props ) {
1312 const { darkMode } = props ;
14- const canPostTeam = props . hasPermission ( 'postTeam' ) ;
13+
14+ const [ canPostTeam , setCanPostTeam ] = useState ( props . hasPermission ( 'postTeam' ) ) ;
15+
16+ // prettier-ignore
17+ if ( canPostTeam === false ) setTimeout ( ( ) => setCanPostTeam ( props . hasPermission ( 'postTeam' ) ) , 1000 ) ;
18+
1519 const inputRef = useRef ( null ) ;
1620
1721 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments