From 44fa24ca526bdc691de32bae0977a8526f876016 Mon Sep 17 00:00:00 2001 From: Claude Worker Date: Thu, 18 Jun 2026 18:48:07 +0000 Subject: [PATCH] refactor: tidy playlist-menu label and catch blocks Pre-push code analysis pass for task #1 ClaudeQueue --- frontend/app.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 96af174..02c4fe6 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1108,8 +1108,7 @@ function openCardMenu(video) { data.playlists.forEach((pl) => { const btn = document.createElement('button'); - const label = () => ((pl.videos.some((x) => x.id === video.id)) ? '✓ ' : '+ ') + pl.name; - btn.textContent = label(); + btn.textContent = (pl.videos.some((x) => x.id === video.id) ? '✓ ' : '+ ') + pl.name; btn.onclick = () => { const key = pl.id + ':' + video.id; // Guard against rapid double-clicks: the op is keyed by playlist+video, @@ -1132,7 +1131,7 @@ function openCardMenu(video) { } persist(); toast(has ? `Removed from ${pl.name}` : `Added to ${pl.name}`); - } catch (e) { + } catch { toast('⚠ Could not update playlist'); } closeModal(); @@ -1331,7 +1330,7 @@ document.querySelectorAll('.chip').forEach((c) => { cachedIds.delete(id); markCardCacheState(id, 'none'); toast('Removed from offline cache'); - } catch (e) { + } catch { // Non-blocking error; leave it marked cached and re-enable the button. toast('⚠ Could not remove from cache'); }