Skip to content

Commit

Permalink
🐛 Fix summary fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Feb 2, 2021
1 parent 134b29c commit 1da4b0d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,20 @@ export const rescuetimeSlack = async () => {
summaries[0]
);
console.log(`Posted ${user}'s summary to Slack`);
} else {
const summaries = await fetchDailySummary(
config.apiKeys[user].replace(
"$API_KEY",
process.env[
`API_KEY_${user.toLocaleUpperCase().replace(/ /g, "_")}`
] ?? ""
)
);
if (!summaries.length) continue;
totalHours += summaries[0].total_hours;
totalScore += Math.floor(
summaries[0].total_hours * summaries[0].productivity_pulse
);
}
}
if (process.argv[2] !== "individual" && process.argv[2] !== "weekly") {
Expand Down

0 comments on commit 1da4b0d

Please sign in to comment.