Skip to content

Commit 3550af7

Browse files
committed
fix: Remove code duplication in getGoals call
1 parent 4c658d7 commit 3550af7

File tree

1 file changed

+2
-8
lines changed
  • packages/plugin-bootstrap/src/evaluators

1 file changed

+2
-8
lines changed

packages/plugin-bootstrap/src/evaluators/goal.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ async function handler(
5555
state: State | undefined,
5656
options: { [key: string]: unknown } = { onlyInProgress: true }
5757
): Promise<Goal[]> {
58-
// get goals
59-
let goalsData = await getGoals({
60-
runtime,
61-
roomId: message.roomId,
62-
onlyInProgress: options.onlyInProgress as boolean,
63-
});
6458

6559
state = (await runtime.composeState(message)) as State;
6660
const context = composeContext({
@@ -79,10 +73,10 @@ async function handler(
7973
const updates = parseJsonArrayFromText(response);
8074

8175
// get goals
82-
goalsData = await getGoals({
76+
const goalsData = await getGoals({
8377
runtime,
8478
roomId: message.roomId,
85-
onlyInProgress: true,
79+
onlyInProgress: options.onlyInProgress as boolean,
8680
});
8781

8882
// Apply the updates to the goals

0 commit comments

Comments
 (0)