File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ export const mergeDraft = (dbFiles: PreviewFile[] = [], draftAdditions: DraftFil
9
9
10
10
// Merge darft additions
11
11
for ( const addition of additions ) {
12
+ // File is new
13
+ if ( addition . new ) {
14
+ mergedFiles . push ( { path : addition . path , parsed : addition . parsed } )
15
+ }
12
16
// File has been renamed
13
- if ( addition . oldPath ) {
17
+ else if ( addition . oldPath ) {
14
18
// Remove old file from deletions (only display renamed one)
15
19
deletions . splice ( deletions . findIndex ( d => d . path === addition . oldPath ) , 1 )
16
20
@@ -39,10 +43,7 @@ export const mergeDraft = (dbFiles: PreviewFile[] = [], draftAdditions: DraftFil
39
43
}
40
44
// File has been added
41
45
}
42
- else if ( addition . new ) {
43
- mergedFiles . push ( { path : addition . path , parsed : addition . parsed } )
44
- // File has been modified
45
- }
46
+ // File has been modified
46
47
else {
47
48
const file = mergedFiles . find ( f => f . path === addition . path )
48
49
if ( file ) {
You can’t perform that action at this time.
0 commit comments