mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
@@ -143,7 +143,7 @@ public static class Extension
|
||||
[CallerFilePath] string filePath = "",
|
||||
[CallerLineNumber] int lineNumber = 0)
|
||||
{
|
||||
return Signal.Defer(() => interaction.Handle(input))
|
||||
return Signal.Defer(() => interaction.WhenHandled(input))
|
||||
.Catch<TOutput, UnhandledInteractionException<TInput, TOutput>>(ex =>
|
||||
{
|
||||
Logging.SaveLog($"Unhandled interaction exception in {memberName} at {filePath}:{lineNumber}", ex);
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
<PackageReference Include="ReactiveUI">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="ReactiveUI.SourceGenerators">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="sqlite-net-e" />
|
||||
<PackageReference Include="Repobot.SQLite.Unofficial" />
|
||||
<PackageReference Include="NLog" />
|
||||
|
||||
@@ -103,6 +103,9 @@ public partial class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
[Reactive]
|
||||
public partial string MasqueHeaders { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public partial string Network { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public partial string RawHeaderType { get; set; }
|
||||
|
||||
@@ -274,7 +277,7 @@ public partial class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
this.WhenAnyValue(x => x.CertSha)
|
||||
.Subscribe(_ => UpdateCertTip());
|
||||
|
||||
this.WhenAnyValue(x => x.SelectedSource.Network)
|
||||
this.WhenAnyValue(x => x.Network)
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
this.RaisePropertyChanged(nameof(TransportHeaderType));
|
||||
@@ -299,6 +302,7 @@ public partial class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
CoreType = SelectedSource?.CoreType?.ToString();
|
||||
AllowInsecure = SelectedSource?.GetAllowInsecure() == true;
|
||||
MuxEnabled = SelectedSource?.MuxEnabled == true;
|
||||
Network = SelectedSource?.Network ?? Global.DefaultNetwork;
|
||||
Cert = SelectedSource?.Cert ?? string.Empty;
|
||||
CertSha = SelectedSource?.CertSha ?? string.Empty;
|
||||
|
||||
@@ -405,10 +409,11 @@ public partial class AddServerViewModel : MyReactiveObject, ICloseable
|
||||
SelectedSource.MuxEnabled = MuxEnabled;
|
||||
SelectedSource.Cert = Cert.IsNullOrEmpty() ? string.Empty : Cert;
|
||||
SelectedSource.CertSha = CertSha.IsNullOrEmpty() ? string.Empty : CertSha;
|
||||
if (!Global.Networks.Contains(SelectedSource.Network))
|
||||
if (!Global.Networks.Contains(Network))
|
||||
{
|
||||
SelectedSource.Network = Global.DefaultNetwork;
|
||||
Network = Global.DefaultNetwork;
|
||||
}
|
||||
SelectedSource.Network = Network;
|
||||
|
||||
var transport = new TransportExtraItem
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ public partial class DNSSettingViewModel : MyReactiveObject, ICloseable
|
||||
[Reactive] public partial bool RayCustomDNSEnableCompatible { get; set; }
|
||||
[Reactive] public partial bool SBCustomDNSEnableCompatible { get; set; }
|
||||
|
||||
public bool IsSimpleDNSEnabled => !(RayCustomDNSEnableCompatible && SBCustomDNSEnableCompatible);
|
||||
[ObservableAsProperty] public partial bool IsSimpleDNSEnabled { get; }
|
||||
|
||||
public ReactiveCommand<RxVoid, RxVoid> SaveCmd { get; }
|
||||
public ReactiveCommand<RxVoid, RxVoid> ImportDefConfig4V2rayCompatibleCmd { get; }
|
||||
@@ -60,8 +60,11 @@ public partial class DNSSettingViewModel : MyReactiveObject, ICloseable
|
||||
await Task.CompletedTask;
|
||||
});
|
||||
|
||||
this.WhenAnyValue(x => x.RayCustomDNSEnableCompatible, x => x.SBCustomDNSEnableCompatible)
|
||||
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsSimpleDNSEnabled)));
|
||||
_isSimpleDNSEnabledHelper = this.WhenAnyValue(
|
||||
x => x.RayCustomDNSEnableCompatible,
|
||||
x => x.SBCustomDNSEnableCompatible,
|
||||
(a, b) => !(a && b))
|
||||
.ToProperty(this, nameof(IsSimpleDNSEnabled));
|
||||
|
||||
_ = Init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user