Skip to content

Commit

Permalink
chore: Fix CA1305, CA2016, and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Oct 10, 2023
1 parent 531b720 commit 95ce1e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//-:cnd:noEmit
using System.Globalization;

namespace MyExtensionsApp._1;

//+:cnd:noEmit
Expand Down Expand Up @@ -123,7 +125,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
credentials ??= new Dictionary<string, string>();
credentials[TokenCacheExtensions.AccessTokenKey] = "SampleToken";
credentials[TokenCacheExtensions.RefreshTokenKey] = "RefreshToken";
credentials["Expiry"] = DateTime.Now.AddMinutes(5).ToString("g");
credentials["Expiry"] = DateTime.Now.AddMinutes(5).ToString("g", DateTimeFormatInfo.InvariantInfo);
return ValueTask.FromResult<IDictionary<string, string>?>(credentials);
}

Expand All @@ -142,7 +144,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
// Return IDictionary containing any tokens used by service calls or in the app
tokenDictionary ??= new Dictionary<string, string>();
tokenDictionary[TokenCacheExtensions.AccessTokenKey] = "NewSampleToken";
tokenDictionary["Expiry"] = DateTime.Now.AddMinutes(5).ToString("g");
tokenDictionary["Expiry"] = DateTime.Now.AddMinutes(5).ToString("g", DateTimeFormatInfo.InvariantInfo);
return ValueTask.FromResult<IDictionary<string, string>?>(tokenDictionary);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial record LoginModel(IDispatcher Dispatcher, INavigator Navigator, I

//+:cnd:noEmit
#if useCustomAuthentication
public IState<string> Username => State<string>.Value(this, () => string.Empty);
public IState<string> Username => State<string>.Value(this, () => string.Empty);

public IState<string> Password => State<string>.Value(this, () => string.Empty);
#endif
Expand All @@ -25,8 +25,7 @@ public async ValueTask Login(CancellationToken token)
//-:cnd:noEmit
if (success)
{
await Navigator.NavigateViewModelAsync<MainModel>(this, qualifier: Qualifiers.ClearBackStack);
await Navigator.NavigateViewModelAsync<MainModel>(this, qualifier: Qualifiers.ClearBackStack, token);
}
}

}

0 comments on commit 95ce1e0

Please sign in to comment.