File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,12 @@ const LeetCodeNotebookToolbar: React.FC<{ notebook: NotebookPanel }> = ({
131131 cellModel . sharedModel . setSource ( source ) ;
132132 } ;
133133
134+ const saveResult = (
135+ result : Extract < LeetCodeSubmissionResult , { state : 'SUCCESS' } >
136+ ) => {
137+ notebook . content . model ?. setMetadata ( 'leetcode_submission_result' , result ) ;
138+ } ;
139+
134140 // one websocket per submission
135141 useEffect ( ( ) => {
136142 if ( ! submissionId ) {
@@ -193,6 +199,7 @@ const LeetCodeNotebookToolbar: React.FC<{ notebook: NotebookPanel }> = ({
193199 populateResultCell ( resultCellModel , result ) ;
194200 NotebookActions . changeCellType ( notebook . content , 'markdown' ) ;
195201 NotebookActions . run ( notebook . content ) ;
202+ saveResult ( result ) ;
196203 notebook . context . save ( ) ;
197204 }
198205 } , [ result ?. state ] ) ;
You can’t perform that action at this time.
0 commit comments