mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
Improved ReactiveCommand.CreateFromTask
This commit is contained in:
@@ -49,14 +49,14 @@ namespace ServiceLib.ViewModels
|
||||
y => y == true)
|
||||
.Subscribe(c => { _config.clashUIItem.connectionsAutoRefresh = AutoRefresh; });
|
||||
|
||||
ConnectionCloseCmd = ReactiveCommand.Create(() =>
|
||||
ConnectionCloseCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
ClashConnectionClose(false);
|
||||
await ClashConnectionClose(false);
|
||||
}, canEditRemove);
|
||||
|
||||
ConnectionCloseAllCmd = ReactiveCommand.Create(() =>
|
||||
ConnectionCloseAllCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
ClashConnectionClose(true);
|
||||
await ClashConnectionClose(true);
|
||||
});
|
||||
|
||||
Init();
|
||||
@@ -177,7 +177,7 @@ namespace ServiceLib.ViewModels
|
||||
_connectionItems.AddRange(lstModel);
|
||||
}
|
||||
|
||||
public void ClashConnectionClose(bool all)
|
||||
public async Task ClashConnectionClose(bool all)
|
||||
{
|
||||
var id = string.Empty;
|
||||
if (!all)
|
||||
|
||||
Reference in New Issue
Block a user