Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 02b44eb

Browse files
authored
Fix added then staged then deleted files (#855)
* Fix unstaged deleted staged added files * Fix key error as well * Fix lint
1 parent a36d60d commit 02b44eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/plugins/GitStatus.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const GitStatusFile: React.StatelessComponent<GitStatusFileProps> = ({
6464
{buttons.map(({buttonText, action}, index) => <span
6565
style={buttonStyles}
6666
onClick={action}
67+
key={index.toString()}
6768
>
6869
{buttonText}
6970
</span>)}
@@ -247,6 +248,15 @@ class GitStatusComponent extends React.Component<GitStatusProps, GitStatusState>
247248
action: resetFile(file.value),
248249
}],
249250
});
251+
unstagedFilesDescriptions.push({
252+
absolutePath: absolutePath,
253+
path: file.value,
254+
state: "deleted",
255+
buttons: [{
256+
buttonText: "Add",
257+
action: addFile(file.value),
258+
}],
259+
});
250260
break;
251261
case "StagedDeleted":
252262
stagedFilesDescriptions.push({

0 commit comments

Comments
 (0)