提交 d7f006ad 编写于 作者: J Jason Park

Keep the tab opened after saving

上级 50767b10
......@@ -42,7 +42,7 @@ class Header extends BaseComponent {
saveGist() {
const { user } = this.props.env;
const { scratchPaper, titles, files, lastFiles } = this.props.current;
const { scratchPaper, titles, files, lastFiles, editingFile } = this.props.current;
const gist = {
description: titles[titles.length - 1],
files: {},
......@@ -75,6 +75,7 @@ class Header extends BaseComponent {
.then(refineGist)
.then(newScratchPaper => {
this.props.setScratchPaper(newScratchPaper);
this.props.setEditingFile(newScratchPaper.files.find(file => file.name === editingFile.name));
if (!(scratchPaper && scratchPaper.gistId === newScratchPaper.gistId)) {
this.props.history.push(`/scratch-paper/${newScratchPaper.gistId}`);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册