@@ -347,10 +347,11 @@ try {
347347 // Render Theme Store
348348 const store = document . querySelector ( `[data-modal-page="store"]` ) ;
349349 if ( store ) {
350- const checks = 0 ;
350+ await storage . idbReady ;
351+ const checks = ( await storage . idbGet ( "cache" ) ) ?. checksCount || 0 ;
351352 const checksText = document . createElement ( "p" ) ;
352353 checksText . classList = 'checks-text' ;
353- checksText . innerHTML = `<i class="bi bi-check2-circle"></i> You've got ${ checks } Checks ` ;
354+ checksText . innerHTML = `<i class="bi bi-check2-circle"></i> You've got ${ checks } Check ${ checks == 1 ? '' : 's' } available to spend! ` ;
354355 store . appendChild ( checksText ) ;
355356 if ( featuredTheme ) {
356357 const promo = document . createElement ( "div" ) ;
@@ -365,7 +366,7 @@ try {
365366 promoButton . addEventListener ( "mouseover" , ( ) => {
366367 initialTheme = document . body . getAttribute ( 'data-theme' ) || '' ;
367368 document . body . setAttribute ( 'data-theme' , featuredTheme [ 0 ] || '' ) ;
368- promoButton . textContent = `Get Theme (${ featuredTheme [ 3 ] ? `${ featuredTheme [ 3 ] } Checks ` : 'Free' } )` ;
369+ promoButton . textContent = `Get Theme (${ featuredTheme [ 3 ] ? `${ featuredTheme [ 3 ] } Check ${ featuredTheme [ 3 ] == 1 ? '' : 's' } ` : 'Free' } )` ;
369370 } ) ;
370371 promoButton . addEventListener ( "mouseout" , ( ) => {
371372 document . body . setAttribute ( 'data-theme' , initialTheme ) ;
@@ -384,15 +385,15 @@ try {
384385 const themeItem = document . createElement ( "div" ) ;
385386 themeItem . classList = 'theme-item' ;
386387 themeItem . setAttribute ( "data-theme" , value ) ;
387- themeItem . setAttribute ( 'tooltip' , `${ name } Theme (${ theme [ 3 ] ? `${ theme [ 3 ] } Checks ` : 'Free' } )` ) ;
388- themeItem . innerHTML = `${ theme [ 2 ] ? `<i class="bi bi-${ theme [ 2 ] } "></i>` : '' } <h5>${ name } </h5><p>${ theme [ 3 ] ? `${ theme [ 3 ] } Checks ` : 'Free' } </p>${ theme [ 4 ] && theme [ 4 ] . length ? `<small>Requires: ${ theme [ 4 ] . map ( t => themes . find ( th => th [ 0 ] == t ) [ 1 ] || t ) . join ( ', ' ) } </small>` : '' } ` ;
388+ themeItem . setAttribute ( 'tooltip' , `${ name } Theme (${ theme [ 3 ] ? `${ theme [ 3 ] } Check ${ theme [ 3 ] == 1 ? '' : 's' } ` : 'Free' } )` ) ;
389+ themeItem . innerHTML = `${ theme [ 2 ] ? `<i class="bi bi-${ theme [ 2 ] } "></i>` : '' } <h5>${ name } </h5><p>${ theme [ 3 ] ? `${ theme [ 3 ] } Check ${ theme [ 3 ] == 1 ? '' : 's' } ` : 'Free' } </p>${ theme [ 4 ] && theme [ 4 ] . length ? `<small>Requires: ${ theme [ 4 ] . map ( t => themes . find ( th => th [ 0 ] == t ) [ 1 ] || t ) . join ( ', ' ) } </small>` : '' } ` ;
389390 if ( value === initialTheme ) themeItem . classList . add ( 'selected' ) ;
390391 const themeButton = document . createElement ( "button" ) ;
391392 themeButton . textContent = "Preview" ;
392393 themeButton . addEventListener ( "mouseover" , ( ) => {
393394 initialTheme = document . body . getAttribute ( 'data-theme' ) || '' ;
394395 document . body . setAttribute ( 'data-theme' , theme [ 0 ] || '' ) ;
395- themeButton . textContent = `Get (${ theme [ 3 ] ? `${ theme [ 3 ] } Checks ` : 'Free' } )` ;
396+ themeButton . textContent = theme [ 3 ] ? `Get (${ theme [ 3 ] ? `${ theme [ 3 ] } Check ${ theme [ 3 ] == 1 ? '' : 's' } ` : 'Free' } )` : 'Apply Now' ;
396397 } ) ;
397398 themeButton . addEventListener ( "mouseout" , ( ) => {
398399 document . body . setAttribute ( 'data-theme' , initialTheme ) ;
0 commit comments