diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-21 11:07:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-21 11:07:49 +0200 |
commit | b63c607b92fd3ec62e370b73e398062bcf317738 (patch) | |
tree | 408324fc028b29a68e82653ebe3a96c54948d23b /client/src | |
parent | 305facdfab1d5029366d2262ac390b9c71752e4b (diff) | |
download | PeerTube-b63c607b92fd3ec62e370b73e398062bcf317738.tar.gz PeerTube-b63c607b92fd3ec62e370b73e398062bcf317738.tar.zst PeerTube-b63c607b92fd3ec62e370b73e398062bcf317738.zip |
Fix updating P2P setting
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/menu/menu.component.html | 4 | ||||
-rw-r--r-- | client/src/app/shared/shared-forms/input-switch.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/shared-forms/input-switch.component.ts | 1 |
3 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html index 6024c7894..d4b2b3330 100644 --- a/client/src/app/menu/menu.component.html +++ b/client/src/app/menu/menu.component.html | |||
@@ -57,11 +57,11 @@ | |||
57 | <span class="ms-auto muted">{{ nsfwPolicy }}</span> | 57 | <span class="ms-auto muted">{{ nsfwPolicy }}</span> |
58 | </a> | 58 | </a> |
59 | 59 | ||
60 | <button class="dropdown-item" (click)="toggleUseP2P()" (mousedown)="$event.stopPropagation()" ngbDropdownItem> | 60 | <button class="dropdown-item" (mousedown)="$event.stopPropagation(); toggleUseP2P()" ngbDropdownItem> |
61 | <my-global-icon iconName="p2p" aria-hidden="true"></my-global-icon> | 61 | <my-global-icon iconName="p2p" aria-hidden="true"></my-global-icon> |
62 | <ng-container i18n>Help share videos</ng-container> | 62 | <ng-container i18n>Help share videos</ng-container> |
63 | 63 | ||
64 | <my-input-switch inputName="p2p-enabled" class="ms-auto" [checked]="user.p2pEnabled"></my-input-switch> | 64 | <my-input-switch inputName="p2p-enabled" class="ms-auto" [preventUpdate]="true" [checked]="user.p2pEnabled"></my-input-switch> |
65 | </button> | 65 | </button> |
66 | 66 | ||
67 | <div class="dropdown-divider"></div> | 67 | <div class="dropdown-divider"></div> |
diff --git a/client/src/app/shared/shared-forms/input-switch.component.html b/client/src/app/shared/shared-forms/input-switch.component.html index 4017d4aa5..2def02a05 100644 --- a/client/src/app/shared/shared-forms/input-switch.component.html +++ b/client/src/app/shared/shared-forms/input-switch.component.html | |||
@@ -1,2 +1,2 @@ | |||
1 | <input type="checkbox" [checked]="checked" [name]="inputName" [id]="inputName" (change)="update()" /> | 1 | <input type="checkbox" [checked]="checked" [name]="inputName" [id]="inputName" (change)="update()" [disabled]="preventUpdate" /> |
2 | <label [for]="inputName" class="ms-auto">Toggle</label> | 2 | <label [for]="inputName" class="ms-auto">Toggle</label> |
diff --git a/client/src/app/shared/shared-forms/input-switch.component.ts b/client/src/app/shared/shared-forms/input-switch.component.ts index abb96de62..e019029c5 100644 --- a/client/src/app/shared/shared-forms/input-switch.component.ts +++ b/client/src/app/shared/shared-forms/input-switch.component.ts | |||
@@ -16,6 +16,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | |||
16 | export class InputSwitchComponent implements ControlValueAccessor { | 16 | export class InputSwitchComponent implements ControlValueAccessor { |
17 | @Input() checked = false | 17 | @Input() checked = false |
18 | @Input() inputName: string | 18 | @Input() inputName: string |
19 | @Input() preventUpdate = false | ||
19 | 20 | ||
20 | propagateChange = (_: any) => { /* empty */ } | 21 | propagateChange = (_: any) => { /* empty */ } |
21 | 22 | ||