File tree Expand file tree Collapse file tree 1 file changed +11
-17
lines changed
src/client/datascience/notebook Expand file tree Collapse file tree 1 file changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -63,24 +63,18 @@ export class NotebookTrustHandler implements IExtensionSingleActivationService {
63
63
DataScience . launchNotebookTrustPrompt ( ) ,
64
64
...prompts
65
65
) ;
66
- if ( ! selection ) {
66
+ if ( selection !== DataScience . trustNotebook ( ) || model . isTrusted ) {
67
67
return ;
68
68
}
69
- if ( model && selection === DataScience . trustNotebook ( ) && ! model . isTrusted ) {
70
- try {
71
- const contents = model . getContent ( ) ;
72
- await this . trustService . trustNotebook ( model . file , contents ) ;
73
- // Update model trust
74
- model . update ( {
75
- source : 'user' ,
76
- kind : 'updateTrust' ,
77
- oldDirty : model . isDirty ,
78
- newDirty : model . isDirty ,
79
- isNotebookTrusted : true
80
- } ) ;
81
- } catch ( err ) {
82
- traceError ( err ) ;
83
- }
84
- }
69
+ const contents = model . getContent ( ) ;
70
+ await this . trustService . trustNotebook ( model . file , contents ) ;
71
+ // Update model trust
72
+ model . update ( {
73
+ source : 'user' ,
74
+ kind : 'updateTrust' ,
75
+ oldDirty : model . isDirty ,
76
+ newDirty : model . isDirty ,
77
+ isNotebookTrusted : true
78
+ } ) ;
85
79
}
86
80
}
You can’t perform that action at this time.
0 commit comments