File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
frontend/src/oso-extensions Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ export interface NotebookHostControls {
88}
99
1010export interface NotebookControls {
11- createCell : ( code : string ) => void ;
11+ createCell : ( code : string ) => Promise < void > ;
1212
13- triggerAlert : ( message : string ) => void ;
13+ triggerAlert : ( message : string ) => Promise < void > ;
1414}
1515
1616export type NotebookControlsStub = RpcStub < NotebookControls > ;
Original file line number Diff line number Diff line change @@ -113,15 +113,15 @@ export class NotebookRpc extends RpcTarget implements NotebookRpcServer {
113113
114114 // We allow late registration of handlers so we can use different handlers
115115 // in the notebook application
116- createCell ( code : string ) : void {
116+ async createCell ( code : string ) : Promise < void > {
117117 if ( ! this . handlers . createCell ) {
118118 console . warn ( "No handler registered for createCell" ) ;
119119 throw new Error ( "No handler registered for createCell" ) ;
120120 }
121121 this . handlers . createCell ( code ) ;
122122 }
123123
124- triggerAlert ( message : string ) : void {
124+ async triggerAlert ( message : string ) : Promise < void > {
125125 if ( ! this . handlers . triggerAlert ) {
126126 console . warn ( "No handler registered for triggerAlert" ) ;
127127 throw new Error ( "No handler registered for triggerAlert" ) ;
@@ -142,10 +142,10 @@ export class NotebookRpc extends RpcTarget implements NotebookRpcServer {
142142}
143143
144144export class DummyNotebookRpc implements NotebookRpcServer {
145- createCell ( code : string ) : void {
145+ async createCell ( code : string ) : Promise < void > {
146146 console . warn ( "DummyNotebookRpc: createCell called with code:" , code ) ;
147147 }
148- triggerAlert ( message : string ) : void {
148+ async triggerAlert ( message : string ) : Promise < void > {
149149 alert ( `DummyNotebookRpc: ${ message } ` ) ;
150150 }
151151 listen ( ) : void {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export const OSOWrapper: React.FC<PropsWithChildren> = ({ children }) => {
3030 const dataSourceActions = useDataSourceActions ( ) ;
3131 const notebookRpcServer = useNotebookRpcServer ( ) ;
3232
33- const createCellAtEnd = useCallback ( ( code : string ) => {
33+ const createCellAtEnd = useCallback ( async ( code : string ) => {
3434 actions . createNewCell ( {
3535 cellId : "__end__" ,
3636 code : code ,
You can’t perform that action at this time.
0 commit comments