Merge pull request #115 from Safelite/feature/CSR-242
Keep static strings and replace dynamic ones
This commit is contained in:
commit
b3caf1cb58
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.
|
||||
stringBuilder = `${stringBuilder} ${storeState}`;
|
||||
stringBuilder = `${stringBuilder} ${stringWithReplacement}`;
|
||||
}
|
||||
|
||||
return stringBuilder.trimStart();
|
||||
|
|
|
|||
Loading…
Reference in a new issue