mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-26 18:24:43 +00:00
Compare commits
2 commits
d471336994
...
67ffa810d3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67ffa810d3 | ||
|
|
ba2a636dd2 |
3 changed files with 10 additions and 15 deletions
|
|
@ -105,14 +105,9 @@ namespace ServiceLib.Handler
|
|||
|
||||
if (Utils.IsNullOrEmpty(config.UiItem.CurrentLanguage))
|
||||
{
|
||||
if (Thread.CurrentThread.CurrentCulture.Name.Equals("zh-cn", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
config.UiItem.CurrentLanguage = Global.Languages.First();
|
||||
}
|
||||
else
|
||||
{
|
||||
config.UiItem.CurrentLanguage = Global.Languages[2];
|
||||
}
|
||||
config.UiItem.CurrentLanguage = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.Equals("zh", StringComparison.CurrentCultureIgnoreCase)
|
||||
? Global.Languages.First()
|
||||
: Global.Languages[2];
|
||||
}
|
||||
|
||||
config.ConstItem ??= new ConstItem();
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ namespace ServiceLib.Services
|
|||
_updateFunc?.Invoke(true, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, "geo"));
|
||||
}
|
||||
|
||||
public async Task RunAvailabilityCheck(Action<bool, string> updateFunc)
|
||||
public async Task<string> RunAvailabilityCheck()
|
||||
{
|
||||
var downloadHandle = new DownloadService();
|
||||
var time = await downloadHandle.RunAvailabilityCheck(null);
|
||||
|
|
@ -255,7 +255,7 @@ namespace ServiceLib.Services
|
|||
ip = $"({ipInfo?.country_code}) {ipInfo?.ip}";
|
||||
}
|
||||
|
||||
updateFunc?.Invoke(false, string.Format(ResUI.TestMeOutput, time, ip));
|
||||
return string.Format(ResUI.TestMeOutput, time, ip);
|
||||
}
|
||||
|
||||
#region CheckUpdate private
|
||||
|
|
|
|||
|
|
@ -311,11 +311,11 @@ namespace ServiceLib.ViewModels
|
|||
{
|
||||
return;
|
||||
}
|
||||
await (new UpdateService()).RunAvailabilityCheck(async (bool success, string msg) =>
|
||||
{
|
||||
|
||||
var msg = await (new UpdateService()).RunAvailabilityCheck();
|
||||
|
||||
NoticeHandler.Instance.SendMessageEx(msg);
|
||||
_updateView?.Invoke(EViewAction.DispatcherServerAvailability, msg);
|
||||
});
|
||||
}
|
||||
|
||||
public void TestServerAvailabilityResult(string msg)
|
||||
|
|
|
|||
Loading…
Reference in a new issue