File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/unity-bootstrap-theme/src/js Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,19 @@ import { EventHandler } from "./bootstrap-helper";
1010function initCardBodies ( ) {
1111
1212 const cardBodies = document . querySelectorAll ( '.card-body' ) ;
13+
14+ // If there are no cardBodies and you have not yet exceeded 3 retries
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+
1326 cardBodies . forEach ( ( cardBody , index ) => {
1427 const paragraph = cardBody . querySelector ( 'div p' ) ;
1528 const originalText = paragraph . textContent ;
You can’t perform that action at this time.
0 commit comments