diff --git a/package.json b/package.json index fbb68ccd..3b9f6d20 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.9.7", + "version": "4.9.8", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/addons.js b/src/addons.js index ede7fa11..cc29460d 100644 --- a/src/addons.js +++ b/src/addons.js @@ -25,6 +25,7 @@ export default class AddonManager extends Module { this.inject('settings'); this.inject('i18n'); + this.has_dev = false; this.reload_required = false; this.addons = {}; this.enabled_addons = []; @@ -126,11 +127,14 @@ export default class AddonManager extends Module { for(const addon of cdn_data ) this.addAddon(addon, false); - if ( Array.isArray(local_data) ) + if ( Array.isArray(local_data) ) { + this.has_dev = true; for(const addon of local_data) this.addAddon(addon, true); + } this.rebuildAddonSearch(); + this.emit(':data-loaded'); } addAddon(addon, is_dev = false) { diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index fd2accb5..7c7eec21 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -26,7 +26,7 @@ const CLASSES = { 'player-event-bar': '.channel-root .live-event-banner-ui__header', 'player-rerun-bar': '.channel-root__player-container div.tw-c-text-overlay:not([data-a-target="hosting-ui-header"])', - 'pinned-cheer': '.pinned-cheer,.pinned-cheer-v2', + 'pinned-cheer': '.pinned-cheer,.pinned-cheer-v2,.channel-leaderboard', 'whispers': 'body .whispers', 'dir-live-ind': '.live-channel-card:not([data-a-target*="host"]) .stream-type-indicator.stream-type-indicator--live,.stream-thumbnail__card .stream-type-indicator.stream-type-indicator--live,.preview-card .stream-type-indicator.stream-type-indicator--live,.preview-card .preview-card-stat.preview-card-stat--live', diff --git a/src/sites/twitch-twilight/modules/menu_button.jsx b/src/sites/twitch-twilight/modules/menu_button.jsx index 6cbb2fcc..09cfa3a2 100644 --- a/src/sites/twitch-twilight/modules/menu_button.jsx +++ b/src/sites/twitch-twilight/modules/menu_button.jsx @@ -15,6 +15,7 @@ export default class MenuButton extends SiteModule { this.inject('i18n'); this.inject('settings'); this.inject('site.fine'); + this.inject('addons'); this.should_enable = true; this._pill_content = null; @@ -108,7 +109,9 @@ export default class MenuButton extends SiteModule { this.on(':clicked', () => this.important_update = false); this.once(':clicked', this.loadMenu); + this.on('i18n:update', this.update); + this.on('addons:data-loaded', this.update); } updateButton(inst) { @@ -148,11 +151,21 @@ export default class MenuButton extends SiteModule {
)} - {!this.has_update && DEBUG && (
+ {!this.has_update && DEBUG && this.addons.has_dev && (
{this.i18n.t('site.menu_button.dev', 'dev')}
)} + {!this.has_update && DEBUG && ! this.addons.has_dev && (
+
+ {this.i18n.t('site.menu_button.main-dev', 'm-dev')} +
+
)} + {!this.has_update && ! DEBUG && this.addons.has_dev && (
+
+ {this.i18n.t('site.menu_button.addon-dev', 'a-dev')} +
+
)} {this.has_new && ! pill && (
{this.i18n.formatNumber(this.new_settings)} @@ -174,7 +187,10 @@ export default class MenuButton extends SiteModule { {this.i18n.t('site.menu_button.new-desc', 'There {count,plural,one {is one new setting} other {are # new settings}}.', {count: this._new_settings})}
)} {DEBUG && (
- {this.i18n.t('site.menu_button.dev-desc', 'You are running a developer build of FrankerFaceZ.')} + {this.i18n.t('site.menu_button.main-dev-desc', 'You are running a developer build of FrankerFaceZ.')} +
)} + {this.addons.has_dev && (
+ {this.i18n.t('site.menu_button.addon-dev-desc', 'You have loaded add-on data from a local development server.')}
)}
diff --git a/src/utilities/module.js b/src/utilities/module.js index f46bfb62..db21e62b 100644 --- a/src/utilities/module.js +++ b/src/utilities/module.js @@ -303,13 +303,13 @@ export class Module extends EventEmitter { return this.onDisable(...args); })().then(ret => { - this.__state = State.ENABLED; + this.__state = State.DISABLED; this.__state_promise = null; this.emit(':disabled', this); return ret; }).catch(err => { - this.__state = State.DISABLED; + this.__state = State.ENABLED; this.__state_promise = null; throw err; });