File tree 1 file changed +9
-6
lines changed
components/dashboard/src/projects 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,15 @@ export default function NewProject() {
50
50
51
51
useEffect ( ( ) => {
52
52
if ( user && authProviders && selectedProviderHost === undefined ) {
53
- const candidate = user . identities [ user . identities . length - 1 ] ;
54
- if ( candidate ) {
55
- const authProvider = authProviders . find ( ( ap ) => ap . authProviderId === candidate . authProviderId ) ;
56
- const host = authProvider ?. host ;
57
- if ( host ) {
58
- setSelectedProviderHost ( host ) ;
53
+ for ( let i = user . identities . length - 1 ; i >= 0 ; i -- ) {
54
+ const candidate = user . identities [ i ] ;
55
+ if ( candidate ) {
56
+ const authProvider = authProviders . find ( ( ap ) => ap . authProviderId === candidate . authProviderId ) ;
57
+ const host = authProvider ?. host ;
58
+ if ( host ) {
59
+ setSelectedProviderHost ( host ) ;
60
+ break ;
61
+ }
59
62
}
60
63
}
61
64
}
You can’t perform that action at this time.
0 commit comments