Keep static strings and replace dynamic ones

This commit is contained in:
Frank 2021-12-22 10:59:33 -05:00
parent 41b9aaf3e1
commit 743410689e

View file

@ -50,8 +50,15 @@ function mapStringToState(str) {
}
}
const stringWithReplacement = str.replace(match[0], storeState);
// If we still have values we need to substitute, call this function again.
if(stringWithReplacement.includes('{globalState:')) {
return mapStringToState(stringWithReplacement);
}
// Concatenate the string.
stringBuilder = `${stringBuilder} ${storeState}`;
stringBuilder = `${stringBuilder} ${stringWithReplacement}`;
}
return stringBuilder.trimStart();