File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/unity-bootstrap-theme/src/js Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,20 @@ import { EventHandler } from "./bootstrap-helper";
99 */
1010function initCardBodies ( ) {
1111 const cardBodies = document . querySelectorAll ( ".card-body" ) ;
12+
13+ // If there are no cardBodies and you have not yet exceeded 3 retries
14+ let retryCount = 0 ;
15+ if ( cardBodies . length === 0 && retryCount < 3 ) {
16+ setTimeout ( ( ) => initCardBodies ( retryCount + 1 ) , 500 ) ;
17+ return ;
18+ }
19+
20+ // If after 3 attempts there are still no cardBodies, we simply exit
21+ if ( cardBodies . length === 0 ) {
22+ console . warn ( "No .card-body found after 3 retries." ) ;
23+ return ;
24+ }
25+
1226 cardBodies . forEach ( ( cardBody , index ) => {
1327 const paragraph = cardBody . querySelector ( "div p" ) ;
1428 const originalText = paragraph . textContent ;
You can’t perform that action at this time.
0 commit comments