mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-02 17:18:31 +00:00
3.5.458. Add a disclaimer to the ITAD popup about the benefits of buying games on Twitch. Fix player volume shenanigans. Closes #126. Closes #125.
This commit is contained in:
parent
61ac0b97f6
commit
1099cc95c2
7 changed files with 77 additions and 42 deletions
25
src/main.js
25
src/main.js
|
@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
|
|||
|
||||
// Version
|
||||
var VER = FFZ.version_info = {
|
||||
major: 3, minor: 5, revision: 457,
|
||||
major: 3, minor: 5, revision: 458,
|
||||
toString: function() {
|
||||
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
||||
}
|
||||
|
@ -167,6 +167,29 @@ FFZ.prototype._pastebin = function(data) {
|
|||
// User Data
|
||||
// -------------------
|
||||
|
||||
FFZ.prototype.get_location = function(force_reload) {
|
||||
var f = this;
|
||||
return new Promise(function(succeed, fail) {
|
||||
if ( ! force_reload && f.__location )
|
||||
succeed(f.__location);
|
||||
|
||||
if ( window.Twitch && Twitch.geo )
|
||||
Twitch.geo.then(function(data) {
|
||||
f.__location = {
|
||||
region: data.region,
|
||||
country: data.geo,
|
||||
lang: data.preferred_language
|
||||
};
|
||||
|
||||
succeed(f.__location);
|
||||
});
|
||||
else
|
||||
// TODO: Implement my own lookup.
|
||||
fail('no provider available');
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
FFZ.prototype.get_user = function(force_reload) {
|
||||
if ( ! force_reload && this.__user && this.__user.chat_oauth_token )
|
||||
return this.__user;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue