Ejemplo n.º 1
0
 internal void SetVisible(string id, bool isVisible)
 {
     if (isVisible)
     {
         localStorage.RemoveItem(VisibleKey(id));
     }
     else
     {
         localStorage.SetItem(VisibleKey(id), isVisible);
     }
 }
        public static void RemoveAuthorizationTokens(this ISyncLocalStorageService localStorage)
        {
            if (localStorage.HasAccessToken())
            {
                localStorage.RemoveItem(LocalStorageConstants.TokenType);
                localStorage.RemoveItem(LocalStorageConstants.AccessToken);
            }

            if (localStorage.HasRefreshToken())
            {
                localStorage.RemoveItem(LocalStorageConstants.RefreshToken);
            }
        }
Ejemplo n.º 3
0
        public void Clear()
        {
            cartItems = new List <CartItemModel>();

            listeners.ForEach(action => action());

            localStorage.RemoveItem(LocalStorageConstants.CartItems);
        }
Ejemplo n.º 4
0
        public void Logout()
        {
            UserDetails = null;
            Username    = null;
            Token       = null;
            _localStorage.RemoveItem("Token");

            UserUpdated?.Invoke(this, new UserEventArgs
            {
                UserDetails    = null,
                IsFullRefresh  = true,
                IsInitialCheck = false
            });
        }
 public bool Clear()
 {
     lock (thisLock)
     {
         if (localStorage.ContainKey(GetFileName()))
         {
             localStorage.RemoveItem(GetFileName());
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Ejemplo n.º 6
0
 public Task LogoutAsync()
 {
     _localstorage.RemoveItem(Constants.ACCESS_TOKEN_NAME);
     _localstorage.RemoveItem(Constants.USER_DATA_NAME);
     return(_js.InvokeVoidAsync("window.location.replace", "/").AsTask());
 }
Ejemplo n.º 7
0
 public void ExitCareer()
 => _localStorageService.RemoveItem(LocalStorageKeys.CURRENT_CAREER);
Ejemplo n.º 8
0
 public void ClearGuestUser()
 {
     _syncLocalStorageService.RemoveItem(_localStorageKey);
     OnAuthenticationStateChanged();
 }