Skip to content

Commit f7671e9

Browse files
CopilotMyst1cX
andcommitted
Add safety check before clicking library button
Co-authored-by: Myst1cX <97919309+Myst1cX@users.noreply.github.com>
1 parent 85db4ad commit f7671e9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

spotifuck-v6.user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,10 @@
213213
// Add delay to allow Spotify's navigation to complete first
214214
// Increased delay to ensure navigation starts before collapsing
215215
setTimeout(() => {
216-
// Use button click to collapse so button state stays synchronized
217-
// Longer delay (300ms) ensures navigation has started and won't be cancelled
218-
if (window.lBtn) {
216+
// Check if library is still expanded before collapsing
217+
// This prevents unnecessary clicks if user manually collapsed it
218+
if (window.lBtn && window.lBtn.getAttribute('aria-label') === 'Collapse Your Library') {
219+
// Library is still expanded, collapse it
219220
window.lBtn.click();
220221
}
221222
closeNowPlay();

0 commit comments

Comments
 (0)