Skip to content

Commit

Permalink
fix incrementation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
techpixel committed Apr 28, 2024
1 parent f27648b commit 58d6765
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/subroutines/events/powerHour.ts
Expand Up @@ -123,6 +123,10 @@ class PowerHour implements BasePicnic {

const elapsedTime = session?.elapsed;

if (!elapsedTime) {
throw new Error("Session not found in database");
}

await client.chat.postMessage({
channel: Environment.POWERHOUR_ORG,
text: `User <@${userId}>'s session was verified! They contributed ${elapsedTime} minutes to the event.`,
Expand All @@ -149,7 +153,7 @@ class PowerHour implements BasePicnic {
},
data: {
minutes: {
increment: elapsedTime,
increment: elapsedTime + 1,
},
sessions: JSON.stringify(eventSessions),
},
Expand Down

0 comments on commit 58d6765

Please sign in to comment.