UI: If Twitch account disconnected, retry login

If the user disconnects OBS from their Twitch account on their Twitch
settings panel, then try asking the user if they'd like to reconnect
before throwing an error.
This commit is contained in:
jp9000
2019-02-20 18:57:49 -08:00
parent c144609ceb
commit 9ffe7f5f94

View File

@@ -102,8 +102,16 @@ try {
throw ErrorInfo("Failed to parse json", error);
error = json["error"].string_value();
if (!error.empty())
if (!error.empty()) {
if (error == "Unauthorized") {
if (RetryLogin()) {
return GetChannelInfo();
}
throw ErrorInfo(error,
json["message"].string_value());
}
throw ErrorInfo(error, json["error_description"].string_value());
}
name = json["name"].string_value();
key_ = json["stream_key"].string_value();