diff --git a/src/sites/twitch-twilight/modules/chat/viewer_card.jsx b/src/sites/twitch-twilight/modules/chat/viewer_card.jsx index c45470c0..89b7fc41 100644 --- a/src/sites/twitch-twilight/modules/chat/viewer_card.jsx +++ b/src/sites/twitch-twilight/modules/chat/viewer_card.jsx @@ -18,13 +18,12 @@ export default class ViewerCards extends Module { this.last_login = null; this.settings.add('chat.viewer-cards.hide-gift-subscribe-button', { - default: '', + default: false, ui: { path: 'Chat > Viewer Cards >> Appearance', - title: 'Hide the gift-subscribe-button on the viewer card', + title: 'Hide "Gift a Sub" button on viewer cards', component: 'setting-check-box' }, - changed: val => this.css_tweaks.toggle('hide-gift-subscribe-button', val) }); this.settings.add('chat.viewer-cards.highlight-chat', { @@ -62,7 +61,9 @@ export default class ViewerCards extends Module { onEnable() { this.chat.context.on('changed:chat.viewer-cards.highlight-chat', this.refreshStyle, this); this.chat.context.on('changed:chat.viewer-cards.color', this.refreshStyle, this); - this.css_tweaks.toggle('hide-gift-subscribe-button', this.settings.get('chat.viewer-cards.hide-gift-subscribe-button')); + this.chat.context.getChanges('chat.viewer-cards.hide-gift-subscribe-button', val => + this.css_tweaks.toggleHide('hide-gift-subscribe-button', val) + ); this.on('..:update-colors', this.refreshStyle, this); this.ViewerCard.on('mount', this.updateCard, this); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index 80bc8b3c..bbdef722 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -46,7 +46,9 @@ const CLASSES = { 'not-live-bar': 'div[data-test-selector="non-live-video-banner-layout"]', 'channel-live-ind': '.channel-header__user .tw-channel-status-text-indicator,.channel-info-content .tw-halo__indicator', 'celebration': 'body .celebration__overlay', - 'mod-view': '.chat-input__buttons-container a[href*="/moderator"]' + 'mod-view': '.chat-input__buttons-container a[href*="/moderator"]', + + 'hide-gift-subscribe-button': 'button[data-test-selector="gift-subscribe-button"]' }; diff --git a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-gift-subscribe-button.scss b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-gift-subscribe-button.scss deleted file mode 100644 index 88562edc..00000000 --- a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-gift-subscribe-button.scss +++ /dev/null @@ -1,3 +0,0 @@ -button[data-test-selector="gift-subscribe-button"] { - display: none !important; -} \ No newline at end of file