Fixed some issues with SettingsDictionary

This commit is contained in:
2024-04-19 00:57:28 +03:00
parent 780614e1e7
commit cadf500400
5 changed files with 45 additions and 88 deletions

View File

@@ -41,11 +41,13 @@ public class JsonManager
text = new MemoryStream(await File.ReadAllBytesAsync(input));
else
text = new MemoryStream(Encoding.ASCII.GetBytes(input));
text.Position = 0;
var obj = await JsonSerializer.DeserializeAsync<T>(text);
await text.FlushAsync();
text.Close();
return (obj ?? default)!;
}
}