1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

4.0.0-rc9

* Added: Emoji to the Emote Menu.
* Changed: Do not look up all a user's emote sets until they actually open the emote menu to reduce server load.
* Changed: Ignore a few extra useless errors with automatic error reporting.
* Fixed: Adding the Prime icon to Subscribe buttons when your free Prime sub is available.
* Fixed: Uncaught exceptions when a pop-up blocker stops us from opening a new tab.
This commit is contained in:
SirStendec 2018-07-26 19:40:53 -04:00
parent 2869eaedd8
commit 43832890b8
10 changed files with 434 additions and 120 deletions

View file

@ -225,8 +225,10 @@ export default class Emotes extends Module {
if ( url ) {
const win = window.open();
win.opener = null;
win.location = url;
if ( win ) {
win.opener = null;
win.location = url;
}
}
return true;
@ -723,14 +725,50 @@ export default class Emotes extends Module {
}
getTwitchSetChannel(set_id, callback) {
const tes = this.__twitch_set_to_channel;
async awaitTwitchSetChannel(set_id, perform_lookup = true) {
const tes = this.__twitch_set_to_channel,
inv = this.twitch_inventory_sets;
if ( isNaN(set_id) || ! isFinite(set_id) )
return null;
if ( tes.has(set_id) )
return tes.get(set_id);
if ( inv.has(set_id) )
return {s_id: set_id, c_id: null, c_name: 'twitch-inventory'}
if ( ! perform_lookup )
return null;
tes.set(set_id, null);
try {
const data = await timeout(this.socket.call('get_emote_set', set_id), 1000);
tes.set(set_id, data);
return data;
} catch(err) {
tes.delete(set_id);
}
}
getTwitchSetChannel(set_id, callback, perform_lookup = true) {
const tes = this.__twitch_set_to_channel,
inv = this.twitch_inventory_sets;
if ( isNaN(set_id) || ! isFinite(set_id) )
return null;
if ( tes.has(set_id) )
return tes.get(set_id);
if ( inv.has(set_id) )
return {s_id: set_id, c_id: null, c_name: 'twitch-inventory'}
if ( ! perform_lookup )
return null;
tes.set(set_id, null);
timeout(this.socket.call('get_emote_set', set_id), 1000).then(data => {
tes.set(set_id, data);