@@ -60,7 +60,7 @@ const Login = () => {
60
60
const location = useLocation ( )
61
61
const history = useHistory ( )
62
62
63
- const [ initLoading , initResult ] = useAsync ( ( ) => Promise . allSettled ( [ getSSOConfigList ( ) , dashboardAccessed ( ) ] ) , [ ] )
63
+ const [ ssoListLoading , ssoListResponse ] = useAsync ( getSSOConfigList , [ ] )
64
64
65
65
const setLoginNavigationURL = ( ) => {
66
66
let queryParam = searchParams . continue
@@ -96,25 +96,15 @@ const Login = () => {
96
96
97
97
useEffect ( ( ) => {
98
98
setLoginNavigationURL ( )
99
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
100
+ dashboardAccessed ( )
99
101
} , [ ] )
100
102
101
103
useEffect ( ( ) => {
102
- if ( initResult && ! initLoading ) {
103
- const [ ssoLoginListResponse , dashboardAccessesResponse ] = initResult
104
- if ( ssoLoginListResponse . status === 'fulfilled' && ssoLoginListResponse . value . result ) {
105
- setLoginList ( ssoLoginListResponse . value . result as SSOConfigLoginList [ ] )
106
- }
107
-
108
- if (
109
- typeof Storage !== 'undefined' &&
110
- ! localStorage . getItem ( 'isDashboardAccessed' ) &&
111
- dashboardAccessesResponse . status === 'fulfilled' &&
112
- dashboardAccessesResponse . value . result
113
- ) {
114
- localStorage . setItem ( 'isDashboardAccessed' , 'true' )
115
- }
104
+ if ( ssoListResponse ?. result && ! ssoListLoading ) {
105
+ setLoginList ( ssoListResponse . result as SSOConfigLoginList [ ] )
116
106
}
117
- } , [ initLoading , initResult ] )
107
+ } , [ ssoListLoading , ssoListResponse ] )
118
108
119
109
const onClickSSO = ( ) => {
120
110
if ( typeof Storage !== 'undefined' ) {
@@ -127,7 +117,7 @@ const Login = () => {
127
117
128
118
const renderSSOLoginPage = ( ) => (
129
119
< div className = "flexbox-col dc__gap-12 p-36" >
130
- { initLoading && ! loginList . length && (
120
+ { ssoListLoading && ! loginList . length && (
131
121
< Button
132
122
variant = { ButtonVariantType . secondary }
133
123
text = "Checking SSO"
0 commit comments