File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 let ffDone = false ; // First fuck done (firstFuck initialization complete)
3737 let pfint = null ; // Primary features interval
3838
39+ // Constants for library button states and timing
40+ const LIBRARY_BUTTON_COLLAPSED = 'Collapse Your Library' ;
41+ const PLAYLIST_NAVIGATION_DELAY_MS = 300 ; // Delay before collapsing library after playlist click
42+
3943 // Note: Class name ".fuckd" used throughout is from original APK source (r0/e.java)
4044 // It marks elements as "already processed" to prevent duplicate event handlers
4145
166170
167171 // Collapse library on startup if it's expanded
168172 // Check if button says "Collapse" (meaning library is currently expanded)
169- if ( libBtn . getAttribute ( 'aria-label' ) === 'Collapse Your Library' ) {
173+ if ( libBtn . getAttribute ( 'aria-label' ) === LIBRARY_BUTTON_COLLAPSED ) {
170174 console . log ( 'Library is expanded on startup, collapsing it...' ) ;
171175 // Click the button to let Spotify update its state properly
172176 // This ensures the button will show "Open your library" after collapse
215219 setTimeout ( ( ) => {
216220 // Check if library is still expanded before collapsing
217221 // This prevents unnecessary clicks if user manually collapsed it
218- if ( window . lBtn && window . lBtn . getAttribute ( 'aria-label' ) === 'Collapse Your Library' ) {
222+ if ( window . lBtn && window . lBtn . getAttribute ( 'aria-label' ) === LIBRARY_BUTTON_COLLAPSED ) {
219223 // Library is still expanded, collapse it
220224 window . lBtn . click ( ) ;
221225 }
222226 closeNowPlay ( ) ;
223- } , 300 ) ; // 300ms ensures playlist navigation has initiated
227+ } , PLAYLIST_NAVIGATION_DELAY_MS ) ;
224228 }
225229 } ) ;
226230 }
You can’t perform that action at this time.
0 commit comments