@@ -669,21 +669,21 @@ function refreshSort(){
669669 else sortContainer . querySelector ( '.chip[sortid]' ) . classList . add ( 'active' ) ;
670670}
671671function handlefavouriteClick ( icon , app , button ) {
672- const favAnimMS = 500 ; // duration of favourite animation in ms
673- // clicked: animate and toggle favourite state immediately for instant feedback
674- let favourite = SETTINGS . favourites . find ( e => e == app . id ) ;
675- changeAppFavourite ( ! favourite , app , false ) ;
676- if ( icon ) icon . classList . toggle ( "icon-favourite-active" , ! favourite ) ;
677- if ( icon ) icon . classList . add ( "favoriteAnim" ) ;
678- // update visible count optimistically (always update, even if 0)
679- let cnt = getAppfavourites ( app ) ;
680- let txt = ( cnt > 999 ) ? Math . round ( cnt / 100 ) / 10 + "k" : cnt ;
681- let countEl = button . querySelector ( '.fav-count' ) ;
682- if ( countEl ) countEl . textContent = String ( txt ) ;
683- // ensure animation class is removed after the duration so it can be re-triggered
684- setTimeout ( ( ) => {
685- try { if ( icon ) icon . classList . remove ( "favoriteAnim" ) ; } catch ( e ) { console . error ( e ) ; }
686- } , favAnimMS ) ;
672+ const favAnimMS = 500 ; // duration of favourite animation in ms
673+ // clicked: animate and toggle favourite state immediately for instant feedback
674+ let favourite = SETTINGS . favourites . find ( e => e == app . id ) ;
675+ changeAppFavourite ( ! favourite , app , false ) ;
676+ if ( icon ) icon . classList . toggle ( "icon-favourite-active" , ! favourite ) ;
677+ if ( icon ) icon . classList . add ( "favoriteAnim" ) ;
678+ // update visible count optimistically (always update, even if 0)
679+ let cnt = getAppfavourites ( app ) ;
680+ let txt = ( cnt > 999 ) ? Math . round ( cnt / 100 ) / 10 + "k" : cnt ;
681+ let countEl = button . querySelector ( '.fav-count' ) ;
682+ if ( countEl ) countEl . textContent = String ( txt ) ;
683+ // ensure animation class is removed after the duration so it can be re-triggered
684+ setTimeout ( ( ) => {
685+ try { if ( icon ) icon . classList . remove ( "favoriteAnim" ) ; } catch ( e ) { console . error ( e ) ; }
686+ } , favAnimMS ) ;
687687}
688688// Refill the library with apps
689689function refreshLibrary ( options ) {
0 commit comments