mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-25 03:58:30 +00:00
* Added: `Current Channel` rule for profiles, to match all pages associated with a certain channel without needing many page rules. * Fixed: Unreadable text in light theme when importing a profile. * Changed: Display a matching page URL in the `Current Page` rule for profiles. * Changed: Do not display an inactive profile warning on the Add-Ons settings page, since those are not affected by profiles. * Changed: Update Vue to a more recent version. * Maintenance: Update the chat types enum based on the latest version of Twitch. * API Added: `TwitchData` module (`site.twitch_data`) for querying Twitch's API for data.
50 lines
No EOL
1.1 KiB
JavaScript
50 lines
No EOL
1.1 KiB
JavaScript
'use strict';
|
|
|
|
// ============================================================================
|
|
// Dashboard
|
|
// ============================================================================
|
|
|
|
import Module from 'utilities/module';
|
|
import { get } from 'utilities/object';
|
|
|
|
export default class Dashboard extends Module {
|
|
constructor(...args) {
|
|
super(...args);
|
|
|
|
this.should_enable = true;
|
|
|
|
this.inject('settings');
|
|
this.inject('site.fine');
|
|
|
|
this.Dashboard = this.fine.define(
|
|
'dashboard',
|
|
n => n.cards && n.defaultCards && n.saveCardsConfig,
|
|
['dash']
|
|
);
|
|
}
|
|
|
|
onEnable() {
|
|
this.Dashboard.on('mount', this.onUpdate, this);
|
|
this.Dashboard.on('update', this.onUpdate, this);
|
|
this.Dashboard.on('unmount', this.onUnmount, this);
|
|
|
|
this.Dashboard.ready((cls, instances) => {
|
|
for(const inst of instances)
|
|
this.onUpdate(inst);
|
|
});
|
|
}
|
|
|
|
onUpdate(inst) {
|
|
this.settings.updateContext({
|
|
channel: get('props.channelLogin', inst),
|
|
channelID: get('props.channelID', inst)
|
|
});
|
|
}
|
|
|
|
onUnmount() {
|
|
this.settings.updateContext({
|
|
channel: null,
|
|
channelID: null
|
|
});
|
|
}
|
|
} |