1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 10:06:54 +00:00
* Added: Setting to change the height of chat actions.
* Added: Profiles can now be toggled via hotkey.
* Added: Profiles can now be imported from URL as well as File.
* Added: Profiles with update URLs can have automatic updates disabled.
* Fixed: Support for the `clips.twitch.tv` domain.
* Fixed: Badges that make use of foreground text are no longer white in light themes.
* Fixed: Mod Icons appearing smaller than normal.
* Changed: Allow several types of actions, unrelated to moderation, to be used on a person's own chat messages.
* Changed: Better warn users in the Control Center when the current profile is set to automatically update.
* Changed: Make the FFZ Control Center remember which profile is selected when re-opening / refreshing.
* API Added: Add-ons can now target specific supported flavors. Choices thus far are `main` and `clips`.
* API Added: The `site.menu_button` now has `addToast(...)` and can display multiple toasts. Toasts can also time out.
* API Fixed: `openFile(...)` never resolving if the user closes the dialog without selecting a file.
This commit is contained in:
SirStendec 2021-03-02 16:55:25 -05:00
parent 0d433c3ebd
commit 9086230686
61 changed files with 2267 additions and 222 deletions

View file

@ -365,24 +365,30 @@ export default class SettingsManager extends Module {
}
checkUpdates() {
async checkUpdates() {
await this.awaitProvider();
await this.provider.awaitReady();
if ( ! this.provider.shouldUpdate )
return;
const promises = [];
for(const profile of this.__profiles) {
if ( ! profile || ! profile.url )
if ( ! profile || ! profile.url || profile.pause_updates )
continue;
const out = profile.checkUpdate();
promises.push(out instanceof Promise ? out : Promise.resolve(out));
}
Promise.all(promises).then(data => {
let success = 0;
for(const thing of data)
if ( thing )
success++;
const data = await Promise.all(promises);
this.log.info(`Successfully refreshed ${success} of ${data.length} profiles from remote URLs.`);
});
let success = 0;
for(const thing of data)
if ( thing )
success++;
this.log.info(`Successfully refreshed ${success} of ${data.length} profiles from remote URLs.`);
}
@ -619,8 +625,10 @@ export default class SettingsManager extends Module {
let reordered = false,
changed = false;
for(const profile of old_profiles)
for(const profile of old_profiles) {
profile.off('toggled', this._onProfileToggled, this);
profile.hotkey_enabled = false;
}
for(const profile_data of raw_profiles) {
const id = profile_data.id,
@ -665,8 +673,10 @@ export default class SettingsManager extends Module {
changed = true;
}
for(const profile of profiles)
for(const profile of profiles) {
profile.on('toggled', this._onProfileToggled, this);
profile.hotkey_enabled = true;
}
if ( ! changed && ! old_ids.size || suppress_events )
return;
@ -707,6 +717,7 @@ export default class SettingsManager extends Module {
this.__profiles.unshift(profile);
profile.on('toggled', this._onProfileToggled, this);
profile.hotkey_enabled = true;
this._saveProfiles();
this.emit(':profile-created', profile);
@ -793,6 +804,8 @@ export default class SettingsManager extends Module {
context(env) { return this.main_context.context(env) }
get(key) { return this.main_context.get(key); }
getChanges(key, fn, ctx) { return this.main_context.getChanges(key, fn, ctx); }
onChange(key, fn, ctx) { return this.main_context.onChange(key, fn, ctx); }
uses(key) { return this.main_context.uses(key) }
update(key) { return this.main_context.update(key) }