mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
fix(renderer): fix force like buttons display logic (#2493)
This commit is contained in:
@ -237,16 +237,16 @@ async function onApiLoaded() {
|
||||
'options.likeButtons',
|
||||
);
|
||||
if (likeButtonsOptions) {
|
||||
const likeButtons: HTMLElement | null = document.querySelector(
|
||||
'ytmusic-like-button-renderer',
|
||||
);
|
||||
if (likeButtons) {
|
||||
likeButtons.style.display =
|
||||
{
|
||||
hide: 'none',
|
||||
force: 'inherit',
|
||||
}[likeButtonsOptions] || '';
|
||||
}
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
ytmusic-player-bar[is-mweb-player-bar-modernization-enabled] .middle-controls-buttons.ytmusic-player-bar, #like-button-renderer {
|
||||
display: ${likeButtonsOptions === 'hide' ? 'none' : 'inherit'} !important;
|
||||
}
|
||||
ytmusic-player-bar[is-mweb-player-bar-modernization-enabled] .middle-controls.ytmusic-player-bar {
|
||||
justify-content: ${likeButtonsOptions === 'hide' ? 'flex-start' : 'space-between'} !important;
|
||||
}`;
|
||||
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user