Skip to content

Commit 77d22c3

Browse files
authored
Merge pull request #2 from scotato/cha0s
Cha0s
2 parents d54f5e8 + 5d45741 commit 77d22c3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

plugins/hooks/use-colossus.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ export function useColossus() {
400400

401401
const handleWithdrawAndReturn = async (planets: Planet[]) => {
402402
/* sanity check */
403+
if (planets.length == 0) {
404+
print(`no rips found, returning...`)
405+
return;
406+
}
403407
const rips = planets.filter((p) => p.planetType == PlanetType.TRADING_POST);
404408
const confirmedPlanets = await makeConfirmedPlanets(rips);
405409
await processAndReturnPlanets(confirmedPlanets, []);

plugins/hooks/use-leaderboard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ export const useLeaderboard = () => {
3535
// console.log('lb', officialLeaderboard.entries)
3636
return colossus.playerCounter().then(async count => {
3737
const lb = []
38+
let totalScore = 0;
3839
for(let i = 0; i < Number(count); i++) {
3940
const address = await colossus.players(i);
4041
const playerScore = await colossus.contributions(address);
4142
const score = Number(playerScore)
43+
totalScore += score;
4244
// console.log(`addy ${address} score ${score}`);
4345
lb.push({ address, score, rank: 0 })
4446
}

0 commit comments

Comments
 (0)