mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 22:17:22 +01:00
use nullorempty
This commit is contained in:
parent
dbf4a90df2
commit
4650893599
4 changed files with 7 additions and 7 deletions
|
|
@ -863,17 +863,17 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
|
||||
public void DrawUpdateOAuthUIDsButton(ServerStorage selectedServer)
|
||||
{
|
||||
using (ImRaii.Disabled(selectedServer.OAuthToken == null))
|
||||
using (ImRaii.Disabled(string.IsNullOrEmpty(selectedServer.OAuthToken)))
|
||||
{
|
||||
if ((_discordOAuthUIDs == null || _discordOAuthUIDs.IsCompleted)
|
||||
&& IconTextButton(FontAwesomeIcon.ArrowsSpin, "Update UIDs from Service")
|
||||
&& selectedServer.OAuthToken != null)
|
||||
&& !string.IsNullOrEmpty(selectedServer.OAuthToken))
|
||||
{
|
||||
_discordOAuthUIDs = _serverConfigurationManager.GetUIDsWithDiscordToken(selectedServer.ServerUri, selectedServer.OAuthToken);
|
||||
}
|
||||
}
|
||||
DateTime tokenExpiry = DateTime.MinValue;
|
||||
if (selectedServer.OAuthToken != null && !_oauthTokenExpiry.TryGetValue(selectedServer.OAuthToken, out tokenExpiry))
|
||||
if (!string.IsNullOrEmpty(selectedServer.OAuthToken) && !_oauthTokenExpiry.TryGetValue(selectedServer.OAuthToken, out tokenExpiry))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -889,7 +889,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
tokenExpiry = DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
if (selectedServer.OAuthToken == null || tokenExpiry < DateTime.UtcNow)
|
||||
if (string.IsNullOrEmpty(selectedServer.OAuthToken) || tokenExpiry < DateTime.UtcNow)
|
||||
{
|
||||
ColorTextWrapped("You have no OAuth token or the OAuth token is expired. Please use the Service Settings to (re)link your OAuth account.", ImGuiColors.DalamudRed);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue