Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AQI->PM25 fix #39

Merged
merged 4 commits into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Start with aqicn, then windWaqi
  • Loading branch information
amaury1093 committed Aug 9, 2018
commit 4e2b63915bb5de84cdb4631aedfe7bceeeeb1597
5 changes: 4 additions & 1 deletion App/Screens/Screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ export default class Screens extends Component {

const api = await retry(
async (_, attempt) => {
const result = await sources[attempt % 2](currentLocation || coords);
// Attempt starts at 1
const result = await sources[(attempt - 1) % 2](
currentLocation || coords
);
return result;
},
{ retries: 3 } // 2 attemps per source
Expand Down
1 change: 0 additions & 1 deletion App/utils/dataSources/windWaqi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import axios from 'axios';

/**
* Fetch the PM2.5 level from https://wind.waqi.info.
* @return {number} - The PM2.5 level.
*/
const windWaqi = async ({ latitude, longitude }) => {
const { data: response } = await axios.get(
Expand Down