Skip to content

Commit d7f006a

Browse files
committed
Keep the tab opened after saving
1 parent 50767b1 commit d7f006a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/frontend/components/Header/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Header extends BaseComponent {
4242

4343
saveGist() {
4444
const { user } = this.props.env;
45-
const { scratchPaper, titles, files, lastFiles } = this.props.current;
45+
const { scratchPaper, titles, files, lastFiles, editingFile } = this.props.current;
4646
const gist = {
4747
description: titles[titles.length - 1],
4848
files: {},
@@ -75,6 +75,7 @@ class Header extends BaseComponent {
7575
.then(refineGist)
7676
.then(newScratchPaper => {
7777
this.props.setScratchPaper(newScratchPaper);
78+
this.props.setEditingFile(newScratchPaper.files.find(file => file.name === editingFile.name));
7879
if (!(scratchPaper && scratchPaper.gistId === newScratchPaper.gistId)) {
7980
this.props.history.push(`/scratch-paper/${newScratchPaper.gistId}`);
8081
}

0 commit comments

Comments
 (0)