@@ -22,23 +22,29 @@ export default function useMeshStyle() {
2222 response_function : ( ) => {
2323 hybridViewerStore . setVisibility ( id , visibility )
2424 dataStyleStore . styles [ id ] . visibility = visibility
25- console . log ( "setMeshVisibility" , dataStyleStore . styles [ id ] . visibility )
2625 } ,
2726 } ,
2827 )
2928 }
3029
31- function applyMeshDefaultStyle ( id ) {
32- const id_style = dataStyleStore . styles [ id ]
33- for ( const [ key , value ] of Object . entries ( id_style ) ) {
34- if ( key == "visibility" ) setMeshVisibility ( id , value )
35- else if ( key == "points" ) pointsStyleStore . applyPointsStyle ( id , value )
36- else if ( key == "edges" ) edgesStyleStore . applyEdgesStyle ( id , value )
37- else if ( key == "polygons" )
38- polygonsStyleStore . applyPolygonsStyle ( id , value )
39- else if ( key == "polyhedra" )
40- polyhedraStyleStore . applyPolyhedraStyle ( id , value )
41- }
30+ async function applyMeshDefaultStyle ( id ) {
31+ return new Promise ( async ( resolve ) => {
32+ const id_style = dataStyleStore . styles [ id ]
33+ for ( const [ key , value ] of Object . entries ( id_style ) ) {
34+ if ( key == "visibility" ) {
35+ await setMeshVisibility ( id , value )
36+ } else if ( key == "points" ) {
37+ await pointsStyleStore . applyPointsStyle ( id , value )
38+ } else if ( key == "edges" ) {
39+ await edgesStyleStore . applyEdgesStyle ( id , value )
40+ } else if ( key == "polygons" ) {
41+ await polygonsStyleStore . applyPolygonsStyle ( id , value )
42+ } else if ( key == "polyhedra" ) {
43+ await polyhedraStyleStore . applyPolyhedraStyle ( id , value )
44+ }
45+ }
46+ resolve ( )
47+ } )
4248 }
4349
4450 return {
0 commit comments