Skip to content

Commit ca3a546

Browse files
fix(ApplyModelSurfacesStyle): harmonise with other stores
1 parent 9925205 commit ca3a546

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

internal_stores/model/surfaces.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ export function useModelSurfacesStyle() {
88
const dataStyleStore = useDataStyleStore()
99
const dataBaseStore = useDataBaseStore()
1010

11+
function modelSurfacesStyle(id) {
12+
return dataStyleStore.getStyle(id).surfaces
13+
}
1114
function modelSurfaceStyle(id, surface_id) {
12-
if (!dataStyleStore.getStyle(id).surfaces[surface_id]) {
13-
dataStyleStore.getStyle(id).surfaces[surface_id] = {}
15+
if (!modelSurfacesStyle(id)[surface_id]) {
16+
modelSurfacesStyle(id)[surface_id] = {}
1417
}
15-
return dataStyleStore.getStyle(id).surfaces[surface_id]
18+
return modelSurfacesStyle(id)[surface_id]
1619
}
1720

1821
function modelSurfaceVisibility(id, surface_id) {
@@ -74,7 +77,7 @@ export function useModelSurfacesStyle() {
7477
}
7578

7679
function applyModelSurfacesStyle(id) {
77-
const style = dataStyleStore.getStyle(id).surfaces
80+
const style = modelSurfacesStyle(id)
7881
const surface_ids = dataBaseStore.getSurfacesUuids(id)
7982
return Promise.all([
8083
setModelSurfacesVisibility(id, surface_ids, style.visibility),

0 commit comments

Comments
 (0)