Skip to content

Commit

Permalink
fix failed flee notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Sep 14, 2023
1 parent c0dacf5 commit f412008
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions ui/src/app/lib/utils/syscalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ export function syscalls({
const battles = [];

const fleeFailedEvents = events.filter(
(event) => event.name === "FleeFailed"
(event) =>
event.name === "FleeFailed" || event.name === "AttackedByBeast"
);
for (let fleeFailedEvent of fleeFailedEvents) {
setData("adventurerByIdQuery", {
Expand All @@ -794,17 +795,6 @@ export function syscalls({
battles.unshift(fleeFailedEvent.data[1]);
}

const attackedByBeastEvents = events.filter(
(event) => event.name === "AttackedByBeast"
);
for (let attackedByBeastEvent of attackedByBeastEvents) {
setData("adventurerByIdQuery", {
adventurers: [attackedByBeastEvent.data[0]],
});
setAdventurer(attackedByBeastEvent.data[0]);
battles.unshift(attackedByBeastEvent.data[1]);
}

const fleeSucceededEvents = events.filter(
(event) => event.name === "FleeSucceeded"
);
Expand Down

1 comment on commit f412008

@vercel
Copy link

@vercel vercel bot commented on f412008 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.