@@ -101,7 +101,6 @@ window.addEventListener('DOMContentLoaded', () => {
101101			const  $el  =  $ ( '#postsetupchecks' ) 
102102			$ ( '#security-warning-state-loading' ) . addClass ( 'hidden' ) 
103103
104- 			let  hasMessages  =  false 
105104			const  $errorsEl  =  $el . find ( '.errors' ) 
106105			const  $warningsEl  =  $el . find ( '.warnings' ) 
107106			const  $infoEl  =  $el . find ( '.info' ) 
@@ -120,33 +119,30 @@ window.addEventListener('DOMContentLoaded', () => {
120119				} 
121120			} 
122121
122+ 			let  hasErrors  =  false 
123+ 			let  hasWarnings  =  false 
124+ 
123125			if  ( $errorsEl . find ( 'li' ) . length  >  0 )  { 
124126				$errorsEl . removeClass ( 'hidden' ) 
125- 				hasMessages  =  true 
127+ 				hasErrors  =  true 
126128			} 
127129			if  ( $warningsEl . find ( 'li' ) . length  >  0 )  { 
128130				$warningsEl . removeClass ( 'hidden' ) 
129- 				hasMessages  =  true 
131+ 				hasWarnings  =  true 
130132			} 
131133			if  ( $infoEl . find ( 'li' ) . length  >  0 )  { 
132134				$infoEl . removeClass ( 'hidden' ) 
133- 				hasMessages  =  true 
134135			} 
135136
136- 			if  ( hasMessages )  { 
137+ 			if  ( hasErrors   ||   hasWarnings )  { 
137138				$ ( '#postsetupchecks-hint' ) . removeClass ( 'hidden' ) 
138- 				if  ( $errorsEl . find ( 'li' ) . length   >   0 )  { 
139+ 				if  ( hasErrors )  { 
139140					$ ( '#security-warning-state-failure' ) . removeClass ( 'hidden' ) 
140141				}  else  { 
141142					$ ( '#security-warning-state-warning' ) . removeClass ( 'hidden' ) 
142143				} 
143144			}  else  { 
144- 				const  securityWarning  =  $ ( '#security-warning' ) 
145- 				if  ( securityWarning . children ( 'ul' ) . children ( ) . length  ===  0 )  { 
146- 					$ ( '#security-warning-state-ok' ) . removeClass ( 'hidden' ) 
147- 				}  else  { 
148- 					$ ( '#security-warning-state-failure' ) . removeClass ( 'hidden' ) 
149- 				} 
145+ 				$ ( '#security-warning-state-ok' ) . removeClass ( 'hidden' ) 
150146			} 
151147		} ) 
152148	} 
0 commit comments