- tweak: server viewmodel cache

This commit is contained in:
2025-01-30 20:18:40 +03:00
parent 88402e7751
commit 329ec268cc
5 changed files with 85 additions and 94 deletions

View File

@@ -54,10 +54,7 @@ public partial class ServerEntryModelView : ViewModelBase
{
try
{
var result =
await RestService.GetAsync<ServerInfo>(Address.InfoUri, CancellationService.Token);
if (result.Value == null) return null;
_serverInfo = result.Value;
_serverInfo = await RestService.GetAsync<ServerInfo>(Address.InfoUri, CancellationService.Token);
}
catch (Exception e)
{
@@ -100,23 +97,6 @@ public partial class ServerEntryModelView : ViewModelBase
CurrLog = ViewHelperService.GetViewModel<LogPopupModelView>();
}
public ServerEntryModelView WithData(ServerHubInfo value)
{
Status = value.StatusData;
Address = value.Address.ToRobustUrl();
Tags.Clear();
foreach (var tag in Status.Tags)
{
Tags.Add(tag);
}
foreach (var tag in value.InferredTags)
{
Tags.Add(tag);
}
return this;
}
public ServerEntryModelView WithData(RobustUrl url, ServerStatus serverStatus)
{
Status = serverStatus;