From 40fb4e0835f4feab8e058e55ccb43f06bb5940ac Mon Sep 17 00:00:00 2001 From: Simon Leech Date: Mon, 13 Nov 2023 15:05:02 +0000 Subject: [PATCH] Update getLayer.js --- mod/workspace/getLayer.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mod/workspace/getLayer.js b/mod/workspace/getLayer.js index 8aa9675d9..43f869885 100644 --- a/mod/workspace/getLayer.js +++ b/mod/workspace/getLayer.js @@ -33,21 +33,24 @@ module.exports = async (params) => { return new Error('Unable to validate layer param.') } - const layer = locale.layers[params.layer] + let layer = locale.layers[params.layer] // Assign key value as key on layer object. layer.key ??= params.layer if (Object.hasOwn(workspace.templates, layer.template || layer.key)) { - - merge(layer, await getTemplate(workspace.templates[layer.template || layer.key])) + // Merge the workspace template into the layer. + layer = + merge(await getTemplate(workspace.templates[layer.template || layer.key]),layer) } if (Array.isArray(layer.templates)) { // Merge templates from templates array into layer. layer.templates.forEach(async template => { - merge(layer, await getTemplate(workspace.templates[template])) + // Merge the workspace template into the layer. + layer = + merge(await getTemplate(workspace.templates[template]),layer) }) }