Keep static strings and replace dynamic ones
This commit is contained in:
parent
41b9aaf3e1
commit
743410689e
1 changed files with 8 additions and 1 deletions
|
|
@ -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.
|
// Concatenate the string.
|
||||||
stringBuilder = `${stringBuilder} ${storeState}`;
|
stringBuilder = `${stringBuilder} ${stringWithReplacement}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return stringBuilder.trimStart();
|
return stringBuilder.trimStart();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue