Display warning if token expired or no token is selected

This commit is contained in:
WarmUpTill
2024-02-08 21:15:07 +01:00
committed by WarmUpTill
parent 9c4fdc9803
commit 5cc5a3d412
7 changed files with 95 additions and 28 deletions

View File

@@ -342,6 +342,15 @@ std::string GetWeakTwitchTokenName(std::weak_ptr<TwitchToken> token)
return con->Name();
}
bool TokenIsValid(const std::weak_ptr<TwitchToken> &token_)
{
auto token = token_.lock();
if (!token) {
return false;
}
return token->IsValid();
}
static bool ConnectionNameAvailable(const QString &name)
{
return !GetTwitchTokenByName(name);