Skip to content

Commit a428f97

Browse files
committed
Update files.js
1 parent b15cac3 commit a428f97

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

files.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,20 @@ function onFileEclipsedInCache(oldSha, newSha, newFile) {
160160
}
161161

162162

163-
// store the file under new sha as key
164-
modifiedFiles[newSha] = oldEclipsedFile;
163+
// if old eclipsed file is modified
164+
if (oldEclipsedFile) {
165+
166+
// store the modified file under new sha as key
167+
modifiedFiles[newSha] = oldEclipsedFile;
168+
169+
} else if (selectedFile.sha === oldSha) {
170+
171+
// if old eclipsed file is selected
172+
173+
// store the selected file under new sha as key
174+
modifiedFiles[newSha] = selectedFile;
175+
176+
}
165177

166178

167179
// update modified files in local storage

0 commit comments

Comments
 (0)