Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Fix the ping results #556

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/api/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ module.exports = (send) => {

// go-ipfs http api currently returns 3 lines for a ping.
// they're a little messed, so take the correct values from each lines.
const Success = res[1].Success
const Time = res[1].Time
const Text = res.length > 2 ? res[2].Text : res[1].Text

const pingResult = {
Success: res[1].Success,
Time: res[1].Time,
Text: res[2].Text
Success: Success,
Time: Time,
Text: Text
}

callback(null, pingResult)
Expand Down