From dee1265b69b15d8f15fb8615a1784ce07d3610ae Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Wed, 24 Feb 2021 09:46:52 +0200 Subject: [PATCH] Fixed: Inline calculations in libarries now display as expected --- .../computation/afterComputation/embedInlineCalculations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/imports/api/creature/computation/afterComputation/embedInlineCalculations.js b/app/imports/api/creature/computation/afterComputation/embedInlineCalculations.js index 02f263c3..10841dba 100644 --- a/app/imports/api/creature/computation/afterComputation/embedInlineCalculations.js +++ b/app/imports/api/creature/computation/afterComputation/embedInlineCalculations.js @@ -4,8 +4,8 @@ export default function embedInlineCalculations(string, calculations){ if (!string) return ''; if (!calculations) return string; let index = 0; - return string.replace(INLINE_CALCULATION_REGEX, () => { + return string.replace(INLINE_CALCULATION_REGEX, substring => { let comp = calculations && calculations[index++]; - return comp && comp.result ? comp.result : string; + return (comp && 'result' in comp) ? comp.result : substring; }); }