Skip to content

Commit baab49c

Browse files
authored
Merge pull request #2817 from bcgov/2724-editing-a-chronology-document-switches-the-type-to-correspondence
Only use default type before value is set
2 parents c45747c + 29b38d9 commit baab49c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export enum VisibilityGroup {
2121
}
2222

2323
@Component({
24-
selector: 'app-document-upload-dialog',
25-
templateUrl: './document-upload-dialog.component.html',
26-
styleUrls: ['./document-upload-dialog.component.scss'],
24+
selector: 'app-document-upload-dialog',
25+
templateUrl: './document-upload-dialog.component.html',
26+
styleUrls: ['./document-upload-dialog.component.scss'],
2727
standalone: false
2828
})
2929
export class DocumentUploadDialogComponent implements OnInit, OnDestroy {
@@ -436,7 +436,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy {
436436
docTypes.sort((a, b) => (a.label > b.label ? 1 : -1));
437437
this.documentTypes = docTypes.filter((type) => type.code !== DOCUMENT_TYPE.ORIGINAL_APPLICATION);
438438

439-
if (this.data.defaultDocumentType) {
439+
if (this.type.value === null && this.data.defaultDocumentType) {
440440
this.type.setValue(this.data.defaultDocumentType);
441441
} else if (this.documentTypes.length === 1) {
442442
this.type.setValue(this.documentTypes[0].code);

0 commit comments

Comments
 (0)