refactor(journal): simplify fallback variable retrieval
Return the fallback value as-is instead of applying local modifications, as the stream value is already authoritative for untracked variables.
This commit is contained in:
parent
4c2eb65470
commit
6f01a29723
|
|
@ -137,14 +137,11 @@ export function getCombined(key: string, fallback?: VariableStore): string {
|
|||
return String(baseNum + modSum);
|
||||
}
|
||||
|
||||
// Fall back to stream store
|
||||
// Fall back to stream store. The stream value is authoritative for
|
||||
// variables not tracked locally — it already includes any mods from
|
||||
// the sender's engine, so we return it as-is without adding local mods.
|
||||
const fb = fallback?.[key];
|
||||
if (fb !== undefined) {
|
||||
if (isTagValue(fb)) return fb;
|
||||
const fbNum = parseFloat(fb);
|
||||
if (!isNaN(fbNum)) return String(fbNum + modSum);
|
||||
return fb;
|
||||
}
|
||||
if (fb !== undefined) return fb;
|
||||
|
||||
// No base, but has mods
|
||||
if (mods.length > 0) return String(modSum);
|
||||
|
|
|
|||
Loading…
Reference in New Issue