refactoring: split all the states

This commit is contained in:
Pieter Vander Vennet 2023-03-25 02:48:24 +01:00
parent 4d48b1cf2b
commit 8e2f04c0d0
32 changed files with 411 additions and 395 deletions

View file

@ -114,7 +114,7 @@ function GenLayerOverviewText(): BaseUIElement {
}
const allLayers: LayerConfig[] = Array.from(AllSharedLayers.sharedLayers.values()).filter(
(layer) => Constants.priviliged_layers.indexOf(layer.id) < 0
(layer) => layer.source === null
)
const builtinLayerIds: Set<string> = new Set<string>()
@ -183,7 +183,7 @@ function GenOverviewsForSingleLayer(
callback: (layer: LayerConfig, element: BaseUIElement, inlineSource: string) => void
): void {
const allLayers: LayerConfig[] = Array.from(AllSharedLayers.sharedLayers.values()).filter(
(layer) => Constants.priviliged_layers.indexOf(layer.id) < 0
(layer) => layer.source !== null
)
const builtinLayerIds: Set<string> = new Set<string>()
allLayers.forEach((l) => builtinLayerIds.add(l.id))
@ -195,7 +195,7 @@ function GenOverviewsForSingleLayer(
}
for (const layer of layout.layers) {
if (Constants.priviliged_layers.indexOf(layer.id) >= 0) {
if (layer.source === null) {
continue
}
if (builtinLayerIds.has(layer.id)) {