Fix anonymous inbound settings save

This commit is contained in:
everoddandeven 2025-03-23 13:38:42 +01:00
parent 56ad4c2653
commit f17bf47216
2 changed files with 2 additions and 6 deletions

View file

@ -1173,7 +1173,7 @@
<div class="col-10">
<label for="tor-anonymous-inbound-address" class="form-label">Inbound Address</label>
<input (input)="onTorAnonymousInboundChange()" [disabled]="!canEditNodeSettings|| currentTorSettings.enabled" type="text" class="form-control" id="tor-anonymous-inbound-address" placeholder="...sxakefmed.onion" [(ngModel)]="torAnonymousInboundAddress" [ngModelOptions]="{standalone: true}">
<input (input)="onTorAnonymousInboundChange()" [disabled]="!canEditNodeSettings|| currentTorSettings.enabled" type="text" class="form-control" id="tor-anonymous-inbound-address" placeholder="yourlongonionaddress.onion" [(ngModel)]="torAnonymousInboundAddress" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">
Specify inbound hidden service address for receiving incoming TOR connections
</small>

View file

@ -160,7 +160,7 @@ export class SettingsComponent extends BasePageComponent {
public i2pAnonymousInboundMaxConnections: number = 0;
public get i2pAnonymousInbound(): string {
const i2pAnonymousInbound = `${this.i2pAnonymousInboundAddress}:${this.i2pAnonymousInboundPort},${this.i2pAnonymousInboundForwardIp}:${this.i2pAnonymousInboundForwardPort}${this.i2pTxProxyMaxConnections > -1 ? ',' + this.i2pAnonymousInboundMaxConnections : ''}`;
const i2pAnonymousInbound = `${this.i2pAnonymousInboundAddress},${this.i2pAnonymousInboundForwardIp}:${this.i2pAnonymousInboundForwardPort}${this.i2pTxProxyMaxConnections > -1 ? ',' + this.i2pAnonymousInboundMaxConnections : ''}`;
if (!DaemonSettings.isValidI2pAnonymousInbound(i2pAnonymousInbound)) return '';
return i2pAnonymousInbound;
@ -431,16 +431,12 @@ export class SettingsComponent extends BasePageComponent {
}
public onTorAnonymousInboundChange(): void {
if (this.torAnonymousInbound == '') return;
const torAnonymousInbound = this.torAnonymousInbound;
this._currentSettings.setAnonymousInbound(torAnonymousInbound, 'tor');
}
public onI2pAnonymousInboundChange(): void {
if (this.i2pAnonymousInbound == '') return;
const i2pAnonymousInbound = this.i2pAnonymousInbound;
this._currentSettings.setAnonymousInbound(i2pAnonymousInbound, 'i2p');