@@ -123,8 +123,8 @@ class App extends React.Component {
123123 . catch ( this . props . showErrorToast ) ;
124124 }
125125
126- loadAlgorithm ( { categoryKey, algorithmKey, gistId } ) {
127- if ( ! this . isGistSaved ( ) && ! window . confirm ( 'Are you sure want to discard changes?' ) ) return ;
126+ loadAlgorithm ( { categoryKey, algorithmKey, gistId } , forceLoad = false ) {
127+ if ( ! forceLoad && ! this . isGistSaved ( ) && ! window . confirm ( 'Are you sure want to discard changes?' ) ) return ;
128128
129129 const { ext } = this . props . env ;
130130 let fetchPromise = null ;
@@ -249,12 +249,12 @@ class App extends React.Component {
249249 </ Helmet >
250250 < Header className = { styles . header } onClickTitleBar = { ( ) => this . toggleNavigatorOpened ( ) }
251251 navigatorOpened = { navigatorOpened } loadScratchPapers = { ( ) => this . loadScratchPapers ( ) }
252- loadAlgorithm = { params => this . loadAlgorithm ( params ) } gistSaved = { gistSaved }
252+ loadAlgorithm = { this . loadAlgorithm . bind ( this ) } gistSaved = { gistSaved }
253253 file = { file } />
254254 < ResizableContainer className = { styles . workspace } horizontal weights = { workspaceWeights }
255255 visibles = { [ navigatorOpened , true , true ] }
256256 onChangeWeights = { weights => this . handleChangeWorkspaceWeights ( weights ) } >
257- < Navigator loadAlgorithm = { params => this . loadAlgorithm ( params ) } />
257+ < Navigator loadAlgorithm = { this . loadAlgorithm . bind ( this ) } />
258258 < VisualizationViewer className = { styles . visualization_viewer } />
259259 < TabContainer className = { styles . editor_tab_container } titles = { editorTitles } tabIndex = { editorTabIndex }
260260 onChangeTabIndex = { tabIndex => this . handleChangeEditorTabIndex ( tabIndex ) } >
0 commit comments