refactor(state): fix code quality findings for runtime and story log
This commit is contained in:
@@ -40,10 +40,14 @@ export function processStoryTriggers(
|
||||
const shouldOpenPanel =
|
||||
enteredNodeIds.length > 0 &&
|
||||
enteredNodeIds.some((id) => shouldAutoNavigateToStory(prefs, id, content));
|
||||
const eventLogLines = logEntries.map((e) =>
|
||||
e.choiceLabel
|
||||
? `Story: ${e.choiceLabel}`
|
||||
: `Story: ${content.storyNodesById[e.nodeId]?.prose.slice(0, 40)}…`,
|
||||
);
|
||||
const customLogs = events.filter((e) => e.kind === 'log').map((e) => e.prose);
|
||||
const eventLogLines = [
|
||||
...customLogs,
|
||||
...logEntries.map((e) =>
|
||||
e.choiceLabel
|
||||
? `Story: ${e.choiceLabel}`
|
||||
: `Story: ${content.storyNodesById[e.nodeId]?.prose.slice(0, 40)}…`,
|
||||
),
|
||||
];
|
||||
return { enteredNodeIds, logEntries, shouldOpenPanel, eventLogLines };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user