mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-06 14:20:56 +00:00
4.2.6
* Fixed: Update Switchboard to allow FFZ to load normally on Twitch's latest update, which updated their version of React Router. * Fixed: Apply the setting to hide Recommended Channels from the sidebar to Popular Channels as well.
This commit is contained in:
parent
4e0539103a
commit
17abc10f7c
5 changed files with 189 additions and 8 deletions
|
@ -5,6 +5,7 @@
|
|||
// ============================================================================
|
||||
|
||||
import Module from 'utilities/module';
|
||||
import {has} from 'utilities/object';
|
||||
|
||||
const PORTRAIT_ROUTES = ['user', 'video', 'user-video', 'user-clip', 'user-videos', 'user-clips', 'user-collections', 'user-events', 'user-followers', 'user-following'];
|
||||
const MINIMAL_ROUTES = ['popout', 'embed-chat'];
|
||||
|
@ -24,6 +25,11 @@ export default class Layout extends Module {
|
|||
n => n.hideOnBreakpoint && n.handleToggleVisibility
|
||||
);
|
||||
|
||||
this.PopularChannels = this.fine.define(
|
||||
'nav-popular',
|
||||
n => n.getPopularChannels && n.props && has(n.props, 'locale')
|
||||
);
|
||||
|
||||
this.settings.add('layout.portrait', {
|
||||
default: false,
|
||||
ui: {
|
||||
|
@ -146,6 +152,14 @@ export default class Layout extends Module {
|
|||
this.css_tweaks.setVariable('portrait-extra-width', `${this.settings.get('layout.portrait-extra-width')}rem`);
|
||||
this.css_tweaks.setVariable('portrait-extra-height', `${this.settings.get('layout.portrait-extra-height')}rem`);
|
||||
|
||||
this.PopularChannels.ready((cls, instances) => {
|
||||
for(const inst of instances)
|
||||
this.updatePopular(inst);
|
||||
});
|
||||
|
||||
this.PopularChannels.on('mount', this.updatePopular, this);
|
||||
this.PopularChannels.on('update', this.updatePopular, this);
|
||||
|
||||
const t = this;
|
||||
this.RightColumn.ready((cls, instances) => {
|
||||
cls.prototype.ffzHideOnBreakpoint = function() {
|
||||
|
@ -196,6 +210,12 @@ export default class Layout extends Module {
|
|||
return this.settings.get('layout.is-minimal')
|
||||
}
|
||||
|
||||
updatePopular(inst) {
|
||||
const node = this.fine.getChildNode(inst);
|
||||
if ( node )
|
||||
node.classList.add('ffz--popular-channels');
|
||||
}
|
||||
|
||||
updatePortraitMode() {
|
||||
for(const inst of this.RightColumn.instances)
|
||||
inst.hideOnBreakpoint();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue