Skip to content

Commit

Permalink
Fixed commas appearing in BGS Report
Browse files Browse the repository at this point in the history
  • Loading branch information
SayakMukhopadhyay committed Jul 17, 2017
1 parent 797b527 commit 2a82ca6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/modules/discord/commands/bgsReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class BGSReport {
factionPromises.push(new Promise((resolve, reject) => {
Promise.all(primaryFactionPromises)
.then(fields => {
resolve([fields]);
resolve(fields);
})
.catch(err => {
reject(err);
Expand All @@ -206,21 +206,26 @@ export class BGSReport {
factionPromises.push(new Promise((resolve, reject) => {
Promise.all(secondaryFactionPromises)
.then(fields => {
resolve([fields]);
resolve(fields);
})
.catch(err => {
reject(err);
})
}));

console.log(factionPromises);

systemPromises.push(new Promise((resolve, reject) => {
Promise.all(factionPromises)
.then(fields => {
let primarySystems: string = fields[0];
let secondarySystems: string = fields[1];
resolve([system, primarySystems + secondarySystems]);
let primarySystems: string[] = fields[0];
let secondarySystems: string[] = fields[1];
let output = "";
primarySystems.forEach(primarySystem => {
output += primarySystem;
});
secondarySystems.forEach(secondarySystem => {
output += secondarySystem;
});
resolve([system, output]);
})
.catch(err => {
reject(err);
Expand Down

0 comments on commit 2a82ca6

Please sign in to comment.