File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -66,19 +66,22 @@ const FavShabadIcon = ({ paneId }) => {
6666 } , [ favShabad , currentShabad ] ) ;
6767
6868 const toggleFavShabad = ( ) => {
69+ setLoading ( true ) ;
6970 if ( favShabadIndex < 0 ) {
70- addToFav ( currentShabad , currentVerse , userToken ) ;
71+ addToFav ( currentShabad , currentVerse , userToken )
72+ . then ( ( ) => fetchFavShabad ( userToken ) )
73+ . then ( ( data ) => {
74+ setFavShabad ( [ ...data ] ) ;
75+ setLoading ( false ) ;
76+ } ) ;
7177 } else {
72- favShabad . splice ( favShabadIndex , 1 ) ;
73- removeFromFav ( currentShabad , userToken ) ;
74- setFavShabad ( [ ...favShabad ] ) ;
78+ removeFromFav ( currentShabad , userToken )
79+ . then ( ( ) => fetchFavShabad ( userToken ) )
80+ . then ( ( data ) => {
81+ setFavShabad ( [ ...data ] ) ;
82+ setLoading ( false ) ;
83+ } ) ;
7584 }
76- const fetchProgress = fetchFavShabad ( userToken ) ;
77- setLoading ( true ) ;
78- fetchProgress . then ( ( data ) => {
79- setFavShabad ( [ ...data ] ) ;
80- setLoading ( false ) ;
81- } ) ;
8285 } ;
8386
8487 if (
Original file line number Diff line number Diff line change 211211 spanEl . style . backgroundColor = 'transparent' ;
212212 } ) ;
213213 document . querySelector ( '.overlay-wrapper' ) . style . backgroundColor = 'transparent' ;
214- // Apply the background color from theme
215- el . style . backgroundColor = `rgba(${ hexToRgb ( overlayPrefs . bgColor ) } , ${ bgOpacity } )` ;
216214 } ) ;
217215
218216 // Special style overrides for vertical layout
You can’t perform that action at this time.
0 commit comments