@@ -123,8 +123,8 @@ class App extends React.Component {
123
123
. catch ( this . props . showErrorToast ) ;
124
124
}
125
125
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 ;
128
128
129
129
const { ext } = this . props . env ;
130
130
let fetchPromise = null ;
@@ -249,12 +249,12 @@ class App extends React.Component {
249
249
</ Helmet >
250
250
< Header className = { styles . header } onClickTitleBar = { ( ) => this . toggleNavigatorOpened ( ) }
251
251
navigatorOpened = { navigatorOpened } loadScratchPapers = { ( ) => this . loadScratchPapers ( ) }
252
- loadAlgorithm = { params => this . loadAlgorithm ( params ) } gistSaved = { gistSaved }
252
+ loadAlgorithm = { this . loadAlgorithm . bind ( this ) } gistSaved = { gistSaved }
253
253
file = { file } />
254
254
< ResizableContainer className = { styles . workspace } horizontal weights = { workspaceWeights }
255
255
visibles = { [ navigatorOpened , true , true ] }
256
256
onChangeWeights = { weights => this . handleChangeWorkspaceWeights ( weights ) } >
257
- < Navigator loadAlgorithm = { params => this . loadAlgorithm ( params ) } />
257
+ < Navigator loadAlgorithm = { this . loadAlgorithm . bind ( this ) } />
258
258
< VisualizationViewer className = { styles . visualization_viewer } />
259
259
< TabContainer className = { styles . editor_tab_container } titles = { editorTitles } tabIndex = { editorTabIndex }
260
260
onChangeTabIndex = { tabIndex => this . handleChangeEditorTabIndex ( tabIndex ) } >
0 commit comments