mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-05 05:08:21 +03:00
Code optimization, function asynchrony
This commit is contained in:
@@ -22,30 +22,21 @@ namespace ServiceLib.ViewModels
|
||||
_config = AppHandler.Instance.Config;
|
||||
_updateView = updateView;
|
||||
|
||||
if (profileItem.indexId.IsNullOrEmpty())
|
||||
{
|
||||
SelectedSource = profileItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedSource = JsonUtils.DeepCopy(profileItem);
|
||||
}
|
||||
CoreType = SelectedSource?.coreType?.ToString();
|
||||
|
||||
BrowseServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
_updateView?.Invoke(EViewAction.BrowseServer, null);
|
||||
});
|
||||
|
||||
EditServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await EditServer();
|
||||
});
|
||||
|
||||
SaveServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await SaveServerAsync();
|
||||
});
|
||||
|
||||
SelectedSource = profileItem.indexId.IsNullOrEmpty() ? profileItem : JsonUtils.DeepCopy(profileItem);
|
||||
CoreType = SelectedSource?.coreType?.ToString();
|
||||
}
|
||||
|
||||
private async Task SaveServerAsync()
|
||||
|
||||
Reference in New Issue
Block a user