PCRB webassembly

This commit is contained in:
Chase Tucker
2024-05-13 14:33:27 -07:00
parent 9b7e3ef897
commit 89790f4fc1
50 changed files with 5466 additions and 677 deletions

View File

@ -165,9 +165,7 @@ public class AuthenticationService : IAuthenticationService {
await _localStorageService.AddItem("MesaFabApprovalUserId", loginId);
}
public async Task SetCurrentUser(User user) {
if (user is null) throw new ArgumentNullException("User cannot be null");
public async Task SetCurrentUser(User? user) {
_cache.Set<User>("MesaFabApprovalCurrentUser", user);
await _localStorageService.AddItem<User>("MesaFabApprovalCurrentUser", user);
}
@ -182,8 +180,10 @@ public class AuthenticationService : IAuthenticationService {
public async Task<User> GetCurrentUser() {
User? currentUser = null;
currentUser = _cache.Get<User>("MesaFabApprovalCurrentUser") ??
await _localStorageService.GetItem<User>("MesaFabApprovalCurrentUser");
currentUser = _cache.Get<User>("MesaFabApprovalCurrentUser");
if (currentUser is null)
currentUser = await _localStorageService.GetItem<User>("MesaFabApprovalCurrentUser");
return currentUser;
}