1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

fixing video settings saving

This commit is contained in:
Patrik J. Braun 2020-02-05 13:48:41 +01:00
parent fcc2e3c537
commit 854bedc968
2 changed files with 4 additions and 3 deletions

View File

@ -198,13 +198,15 @@ export abstract class SettingsComponent<T extends { [key: string]: any }, S exte
const add = (obj: any, to: any): void => { const add = (obj: any, to: any): void => {
for (const key of Object.keys(obj)) { for (const key of Object.keys(obj)) {
to[key] = {}; to[key] = {};
if (obj[key].isConfigType) { if (obj[key].isConfigType || (typeof obj[key] === 'object' && typeof obj[key].value === 'undefined')) {
return add(obj[key], to[key]); add(obj[key], to[key]);
continue;
} }
to[key] = obj[key].value; to[key] = obj[key].value;
} }
}; };
add(this.states, ret); add(this.states, ret);
return ret; return ret;
} }

View File

@ -2,7 +2,6 @@
<div class="card mb-4"> <div class="card mb-4">
<h5 class="card-header"> <h5 class="card-header">
{{Name}} {{Name}}
<ng-container *ngIf="changed">*</ng-container>
<div class="switch-wrapper"> <div class="switch-wrapper">
<bSwitch <bSwitch
class="switch" class="switch"