Fix updating P2P setting
This commit is contained in:
parent
305facdfab
commit
b63c607b92
3 changed files with 4 additions and 3 deletions
|
@ -57,11 +57,11 @@
|
|||
<span class="ms-auto muted">{{ nsfwPolicy }}</span>
|
||||
</a>
|
||||
|
||||
<button class="dropdown-item" (click)="toggleUseP2P()" (mousedown)="$event.stopPropagation()" ngbDropdownItem>
|
||||
<button class="dropdown-item" (mousedown)="$event.stopPropagation(); toggleUseP2P()" ngbDropdownItem>
|
||||
<my-global-icon iconName="p2p" aria-hidden="true"></my-global-icon>
|
||||
<ng-container i18n>Help share videos</ng-container>
|
||||
|
||||
<my-input-switch inputName="p2p-enabled" class="ms-auto" [checked]="user.p2pEnabled"></my-input-switch>
|
||||
<my-input-switch inputName="p2p-enabled" class="ms-auto" [preventUpdate]="true" [checked]="user.p2pEnabled"></my-input-switch>
|
||||
</button>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<input type="checkbox" [checked]="checked" [name]="inputName" [id]="inputName" (change)="update()" />
|
||||
<input type="checkbox" [checked]="checked" [name]="inputName" [id]="inputName" (change)="update()" [disabled]="preventUpdate" />
|
||||
<label [for]="inputName" class="ms-auto">Toggle</label>
|
||||
|
|
|
@ -16,6 +16,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
|||
export class InputSwitchComponent implements ControlValueAccessor {
|
||||
@Input() checked = false
|
||||
@Input() inputName: string
|
||||
@Input() preventUpdate = false
|
||||
|
||||
propagateChange = (_: any) => { /* empty */ }
|
||||
|
||||
|
|
Loading…
Reference in a new issue