Skip to content

Commit 3f11f6b

Browse files
committed
Fix view create API call
Signed-off-by: Francesco Torchia <[email protected]>
1 parent 5eeff3c commit 3f11f6b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/console/src/app/components/forms/view-create-form/view-create-form.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { TranslateService } from '@ngx-translate/core';
77
import { FormControl, Validators } from '@angular/forms';
88
import { GitSelectStateMatcher, InputStateMatcher } from 'src/app/validations/state-matcher';
99
import { CustomValidators } from 'src/app/validations/validators';
10+
import { ErrorDialogComponent } from '../../dialogs/error-dialog/error-dialog.component';
1011

1112
@Component({
1213
selector: 'app-view-create-form',
@@ -169,6 +170,17 @@ export class ViewCreateFormComponent implements OnInit, OnDestroy {
169170
return;
170171
}
171172

173+
try {
174+
this.view.general.vscodeSettings = JSON.parse(this.view.general.vscodeSettings || '{}');
175+
} catch (error) {
176+
this.dialog.open(ErrorDialogComponent, {
177+
width: '300px',
178+
height: '150px',
179+
data: { err: 'VSCode Settings, invalid json file' },
180+
});
181+
return;
182+
}
183+
172184
if (this.repositoryInfo) {
173185
if (this.view.repo) {
174186
this.view.repo.git.commit = this.view.repo.git.branch;

0 commit comments

Comments
 (0)