Skip to content

Commit

Permalink
🚧 Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Nov 21, 2023
1 parent e777bfe commit c4f7bf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task<bool> SaveSession(SteamSession steamSession)
try
{
var temp = Serializable.SJSON(steamSession);
await ISecureStorage.Instance.SetAsync("CurrentSteamUserSession", temp);
await ISecureStorage.Instance.SetAsync(ISteamSessionService.CurrentSteamUserKey, temp);
return true;
}
catch (Exception ex)
Expand All @@ -58,11 +58,11 @@ public async Task<bool> SaveSession(SteamSession steamSession)
return false;
}

public async Task<SteamSession?> LoadSession(string filePath)
public async Task<SteamSession?> LoadSession()
{
try
{
var text = await ISecureStorage.Instance.GetAsync("CurrentSteamUserSession");
var text = await ISecureStorage.Instance.GetAsync(ISteamSessionService.CurrentSteamUserKey);
if (text != null)
{
var session = Serializable.DJSON<SteamSession>(text);
Expand Down
4 changes: 3 additions & 1 deletion src/BD.SteamClient/Services/ISteamSessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ namespace BD.SteamClient.Services;

public interface ISteamSessionService
{
public const string CurrentSteamUserKey = "CurrentSteamUser";

static ISteamSessionService Instance => Ioc.Get<ISteamSessionService>();

bool AddOrSetSeesion(SteamSession steamSession);

SteamSession? RentSession(string steam_id);

Task<SteamSession?> LoadSession(string filePath);
Task<SteamSession?> LoadSession();

Task<bool> SaveSession(SteamSession steamSession);

Expand Down

0 comments on commit c4f7bf3

Please sign in to comment.