Skip to content

Commit

Permalink
Fix view create API call
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
  • Loading branch information
torchiaf committed May 24, 2024
1 parent 5eeff3c commit 3f11f6b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TranslateService } from '@ngx-translate/core';
import { FormControl, Validators } from '@angular/forms';
import { GitSelectStateMatcher, InputStateMatcher } from 'src/app/validations/state-matcher';
import { CustomValidators } from 'src/app/validations/validators';
import { ErrorDialogComponent } from '../../dialogs/error-dialog/error-dialog.component';

@Component({
selector: 'app-view-create-form',
Expand Down Expand Up @@ -169,6 +170,17 @@ export class ViewCreateFormComponent implements OnInit, OnDestroy {
return;
}

try {
this.view.general.vscodeSettings = JSON.parse(this.view.general.vscodeSettings || '{}');
} catch (error) {
this.dialog.open(ErrorDialogComponent, {
width: '300px',
height: '150px',
data: { err: 'VSCode Settings, invalid json file' },
});
return;
}

if (this.repositoryInfo) {
if (this.view.repo) {
this.view.repo.git.commit = this.view.repo.git.branch;
Expand Down

0 comments on commit 3f11f6b

Please sign in to comment.