mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 21:28:51 +00:00
Fix issue when saving gui config
This commit is contained in:
parent
bcda8bd602
commit
52b8f480f6
1 changed files with 13 additions and 11 deletions
|
@ -210,18 +210,20 @@ namespace v2rayN.Handler
|
|||
{
|
||||
try
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
//save temp file
|
||||
var temp = $"{configRes}_temp";
|
||||
if (Utils.ToJsonFile(config, Utils.GetPath(temp)) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//rename
|
||||
File.Move(temp, configRes);
|
||||
});
|
||||
//save temp file
|
||||
var temp = $"{configRes}_temp";
|
||||
if (Utils.ToJsonFile(config, Utils.GetPath(temp)) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (File.Exists(configRes))
|
||||
{
|
||||
File.Delete(configRes);
|
||||
}
|
||||
//rename
|
||||
File.Move(temp, configRes);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue