mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-08 22:49:48 +03:00
@@ -9,6 +9,11 @@ public partial class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
[Reactive]
|
||||
public partial string CustomCoreType { get; set; }
|
||||
[Reactive]
|
||||
public partial string PrevProfile { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public partial string NextProfile { get; set; }
|
||||
|
||||
public ReactiveCommand<RxVoid, RxVoid> SelectPrevProfileCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> SelectNextProfileCmd { get; }
|
||||
@@ -23,8 +28,7 @@ public partial class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
var profileItem = await SelectProfileAsync();
|
||||
if (profileItem != null)
|
||||
{
|
||||
SelectedSource?.PrevProfile = profileItem.Remarks;
|
||||
SelectedSource = JsonUtils.DeepCopy(SelectedSource);
|
||||
PrevProfile = profileItem.Remarks;
|
||||
}
|
||||
});
|
||||
SelectNextProfileCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
@@ -32,8 +36,7 @@ public partial class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
var profileItem = await SelectProfileAsync();
|
||||
if (profileItem != null)
|
||||
{
|
||||
SelectedSource?.NextProfile = profileItem.Remarks;
|
||||
SelectedSource = JsonUtils.DeepCopy(SelectedSource);
|
||||
NextProfile = profileItem.Remarks;
|
||||
}
|
||||
});
|
||||
SaveCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
@@ -43,6 +46,8 @@ public partial class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
|
||||
SelectedSource = subItem.Id.IsNullOrEmpty() ? subItem : JsonUtils.DeepCopy(subItem);
|
||||
CustomCoreType = SelectedSource.CustomCoreType?.ToString() ?? string.Empty;
|
||||
PrevProfile = SelectedSource.PrevProfile;
|
||||
NextProfile = SelectedSource.NextProfile;
|
||||
}
|
||||
|
||||
private async Task SaveSubAsync()
|
||||
@@ -72,6 +77,8 @@ public partial class SubEditViewModel : MyReactiveObject, ICloseable
|
||||
}
|
||||
|
||||
SelectedSource.CustomCoreType = Enum.TryParse<ECoreType>(CustomCoreType, out var coreType) ? coreType : null;
|
||||
SelectedSource.PrevProfile = PrevProfile;
|
||||
SelectedSource.NextProfile = NextProfile;
|
||||
|
||||
if (await ConfigHandler.AddSubItem(_config, SelectedSource) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user