mirror of
https://github.com/spacebarchat/server.git
synced 2026-09-25 09:05:16 +00:00
client: gateway retry, session remove
This commit is contained in:
@@ -33,6 +33,17 @@ public class SessionStore(ILogger<SessionStore> logger, LocalStorageService loca
|
||||
public async Task SetCurrentSessionAsync(Guid sessionId) {
|
||||
await localStorage.SetItemAsJsonAsync(CurrentSessionKey, sessionId);
|
||||
}
|
||||
|
||||
public async Task RemoveSessionAsync(Guid sessionId)
|
||||
{
|
||||
var sessions = await GetAllSessionsAsync();
|
||||
sessions.Remove(sessionId);
|
||||
await localStorage.SetItemAsJsonAsync(AllSessionsKey, sessions);
|
||||
|
||||
if (await localStorage.ContainsKeyAsync(CurrentSessionKey))
|
||||
if (await localStorage.GetItemFromJsonAsync<Guid>(CurrentSessionKey) == sessionId)
|
||||
await localStorage.RemoveItemAsync(CurrentSessionKey);
|
||||
}
|
||||
}
|
||||
|
||||
public class SessionEntry {
|
||||
|
||||
Reference in New Issue
Block a user