diff --git a/src/frontend/components/App/index.jsx b/src/frontend/components/App/index.jsx index 99cc522e100db03a931fb5f2603fd4d16534999c..6d981f0192ee4953f64a88d3ffe30a86d10a4497 100644 --- a/src/frontend/components/App/index.jsx +++ b/src/frontend/components/App/index.jsx @@ -123,8 +123,8 @@ class App extends React.Component { .catch(this.props.showErrorToast); } - loadAlgorithm({ categoryKey, algorithmKey, gistId }) { - if (!this.isGistSaved() && !window.confirm('Are you sure want to discard changes?')) return; + loadAlgorithm({ categoryKey, algorithmKey, gistId }, forceLoad = false) { + if (!forceLoad && !this.isGistSaved() && !window.confirm('Are you sure want to discard changes?')) return; const { ext } = this.props.env; let fetchPromise = null; @@ -249,12 +249,12 @@ class App extends React.Component {
this.toggleNavigatorOpened()} navigatorOpened={navigatorOpened} loadScratchPapers={() => this.loadScratchPapers()} - loadAlgorithm={params => this.loadAlgorithm(params)} gistSaved={gistSaved} + loadAlgorithm={this.loadAlgorithm.bind(this)} gistSaved={gistSaved} file={file} /> this.handleChangeWorkspaceWeights(weights)}> - this.loadAlgorithm(params)} /> + this.handleChangeEditorTabIndex(tabIndex)}> diff --git a/src/frontend/components/Header/index.jsx b/src/frontend/components/Header/index.jsx index 4004637fdba106ed62378829bce1fee43edcfc9a..2e6242b59152c618ab6931b812006b772dc8563c 100644 --- a/src/frontend/components/Header/index.jsx +++ b/src/frontend/components/Header/index.jsx @@ -69,7 +69,7 @@ class Header extends React.Component { const { gistId } = this.props.current; const deletePromise = gistId === 'new' ? Promise.resolve() : GitHubApi.deleteGist(gistId); deletePromise - .then(() => this.props.loadAlgorithm({})) + .then(() => this.props.loadAlgorithm({}, true)) .then(this.props.loadScratchPapers) .catch(this.props.showErrorToast); }