File tree Expand file tree Collapse file tree
js/src/components/perspective Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const perspective_init_promise = Promise.all([
1515
1616export const fetchTables = async ( ) => {
1717 await perspective_init_promise ;
18+ const worker = await perspective . worker ( ) ;
1819 const protocol = window . location . protocol === "https:" ? "wss:" : "ws:" ;
1920 const websocket = await perspective . websocket (
2021 `${ protocol } //${ window . location . host } /api/v1/perspective` ,
@@ -23,9 +24,13 @@ export const fetchTables = async () => {
2324 const response = await fetch ( "/api/v1/perspective/tables" ) ;
2425 const schemas = await response . json ( ) ;
2526 const table_names = [ ...Object . keys ( schemas ) ] ;
26- const tables = await Promise . all (
27+ const table_handles = await Promise . all (
2728 table_names . map ( ( table_name ) => websocket . open_table ( table_name ) ) ,
2829 ) ;
30+ const views = await Promise . all (
31+ table_handles . map ( ( table_handle ) => table_handle . view ( ) ) ,
32+ ) ;
33+ const tables = await Promise . all ( views . map ( ( view ) => worker . table ( view ) ) ) ;
2934 const new_tables = { } ;
3035 table_names . forEach ( ( table_name , index ) => {
3136 new_tables [ table_name ] = {
You can’t perform that action at this time.
0 commit comments