From 72ba1b902872533d722f8d656f23ee10aaf26025 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Tue, 9 Nov 2021 11:48:15 +0100 Subject: [PATCH] Send models-request message --- packages/voila/src/manager.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/voila/src/manager.ts b/packages/voila/src/manager.ts index 2da5f3990..7e468a2fd 100644 --- a/packages/voila/src/manager.ts +++ b/packages/voila/src/manager.ts @@ -199,9 +199,12 @@ export class WidgetManager extends JupyterLabManager { 'jupyter.widget.control', commId, { widgets: null }, - { 'version': '1.0.0' } + { version: '1.0.0' } ); + // Send a models request msg + initComm.send({type: 'models-request'}, {}); + let [widgetsInfo, buffers]: any = await new Promise(resolve => { initComm.on_msg(msg => { const info = msg['content']['data']; @@ -212,7 +215,8 @@ export class WidgetManager extends JupyterLabManager { } else { return new DataView(b instanceof ArrayBuffer ? b : b.buffer); } - }); + }); + resolve([info, buffers]); }); });