refactor: tidy playlist-menu label and catch blocks
Pre-push code analysis pass for task #1 ClaudeQueue
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user