pull/3405/head^2
2dust 2 years ago
parent 947a7aa7df
commit 285f91e9e8

@ -959,7 +959,7 @@ namespace v2rayN.Handler
var existItem = lstOriSub?.FirstOrDefault(t => CompareProfileItem(t, profileItem, true)); var existItem = lstOriSub?.FirstOrDefault(t => CompareProfileItem(t, profileItem, true));
if (existItem != null) if (existItem != null)
{ {
profileItem = existItem; profileItem.indexId = existItem.indexId;
} }
//filter //filter
if (!Utils.IsNullOrEmpty(subFilter)) if (!Utils.IsNullOrEmpty(subFilter))

@ -299,7 +299,7 @@ namespace v2rayN.ViewModels
UI.Show(ResUI.OperationSuccess); UI.Show(ResUI.OperationSuccess);
} }
} }
private void ImportRulesFromUrl() private async Task ImportRulesFromUrl()
{ {
var url = SelectedRouting.url; var url = SelectedRouting.url;
if (Utils.IsNullOrEmpty(url)) if (Utils.IsNullOrEmpty(url))
@ -308,10 +308,8 @@ namespace v2rayN.ViewModels
return; return;
} }
Task.Run(async () =>
{
DownloadHandle downloadHandle = new DownloadHandle(); DownloadHandle downloadHandle = new DownloadHandle();
string result = await downloadHandle.DownloadStringAsync(url, false, ""); string result = await downloadHandle.TryDownloadString(url, true, "");
if (AddBatchRoutingRules(SelectedRouting, result) == 0) if (AddBatchRoutingRules(SelectedRouting, result) == 0)
{ {
Application.Current.Dispatcher.Invoke((Action)(() => Application.Current.Dispatcher.Invoke((Action)(() =>
@ -320,7 +318,6 @@ namespace v2rayN.ViewModels
})); }));
UI.Show(ResUI.OperationSuccess); UI.Show(ResUI.OperationSuccess);
} }
});
} }
private int AddBatchRoutingRules(RoutingItem routingItem, string clipboardData) private int AddBatchRoutingRules(RoutingItem routingItem, string clipboardData)
{ {

Loading…
Cancel
Save