refactor: isAllowedType checks for hidden speckle types (#2481)

This commit is contained in:
andrewwallacespeckle
2024-07-09 15:32:18 +01:00
committed by GitHub
parent b119f2ee83
commit a72ef6178d
@@ -307,8 +307,18 @@ const isNonEmptyObjectArray = (x: unknown) => isNonEmptyArray(x) && isObject(x[0
const isObject = (x: unknown) =>
typeof x === 'object' && !Array.isArray(x) && x !== null
const isAllowedType = (node: ExplorerNode) =>
!['Objects.Other.DisplayStyle'].includes(node.raw?.speckle_type || '')
const hiddenSpeckleTypes = [
'Objects.Other.DisplayStyle',
'Objects.Other.Revit.RevitMaterial',
'Objects.BuiltElements.Revit.ProjectInfo',
'Objects.BuiltElements.View',
'Objects.BuiltElements.View3D'
]
const isAllowedType = (node: ExplorerNode) => {
const speckleType = node.raw?.speckle_type || ''
return !hiddenSpeckleTypes.some((substring) => speckleType.includes(substring))
}
const unfold = ref(false)