Skip to content

Commit 965565f

Browse files
committed
chore: remove redundant state for login list
1 parent 01e53c6 commit 965565f

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/components/login/Login.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import { TOKEN_COOKIE_NAME, URLS } from '../../config'
4343
import { getSSOConfigList } from '../../Pages/GlobalConfigurations/Authorization/SSOLoginServices/service'
4444
import { dashboardAccessed } from '../../services/service'
4545
import { LOGIN_CARD_ANIMATION_VARIANTS, SSOProvider } from './constants'
46-
import { SSOConfigLoginList } from './login.types'
4746
import { LoginForm } from './LoginForm'
4847

4948
import './login.scss'
@@ -54,14 +53,15 @@ const getTermsAndConditions = importComponentFromFELibrary('getTermsAndCondition
5453

5554
const Login = () => {
5655
const [continueUrl, setContinueUrl] = useState('')
57-
const [loginList, setLoginList] = useState<SSOConfigLoginList[]>([])
5856

5957
const { searchParams } = useSearchString()
6058
const location = useLocation()
6159
const history = useHistory()
6260

6361
const [ssoListLoading, ssoListResponse] = useAsync(getSSOConfigList, [])
6462

63+
const loginList = ssoListResponse?.result ?? []
64+
6565
const setLoginNavigationURL = () => {
6666
let queryParam = searchParams.continue
6767

@@ -100,12 +100,6 @@ const Login = () => {
100100
dashboardAccessed()
101101
}, [])
102102

103-
useEffect(() => {
104-
if (ssoListResponse?.result && !ssoListLoading) {
105-
setLoginList(ssoListResponse.result as SSOConfigLoginList[])
106-
}
107-
}, [ssoListLoading, ssoListResponse])
108-
109103
const onClickSSO = () => {
110104
if (typeof Storage !== 'undefined') {
111105
localStorage.setItem('isSSOLogin', 'true')

src/components/login/login.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export interface SSOConfigLoginList extends Pick<SSOConfigDTO, 'id' | 'active' |
2121
}
2222

2323
export interface LoginFormType {
24-
loginList: SSOConfigLoginList[]
24+
loginList: SSOConfigDTO[]
2525
}

0 commit comments

Comments
 (0)