Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
v5.1
Browse files Browse the repository at this point in the history
Fix bug on init
  • Loading branch information
dieghernan committed Apr 16, 2017
1 parent 9eae42e commit 3550475
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@
"watchface": true
}
},
"version": "5.0.0"
"version": "5.1.0"
}
37 changes: 0 additions & 37 deletions src/pkjs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,50 +224,13 @@ function locationError(err) {
}

function getWeatherAtInit() {
// Get keys from pmkey
var settings = JSON.parse(localStorage.getItem('clay-settings')) || {};
var email=settings.EmailPMKEY;
var pin=settings.PINPMKEY;
//Request API from pmkey.xyz
var urlpmk='https://pmkey.xyz/search/?email='+email+"&pin="+pin;
console.log("Url PMKEY is "+ urlpmk);
xhrRequest(encodeURI(urlpmk),'GET',
function(responseText){
var jsonpmk=JSON.parse(responseText);
var wuKey=jsonpmk.keys.weather.wu;
var owmKey=jsonpmk.keys.weather.owm;

localStorage.setItem("wuKey", wuKey);
localStorage.setItem("owmKey", owmKey);
}
);

var weatherprov=settings.WeatherProv;
if (weatherprov=="yahoo"){
console.log("Requesting weather from Yahoo");
navigator.geolocation.getCurrentPosition(
locationSuccessYahoo,
locationError,
{enableHighAccuracy:true,timeout: 15000, maximumAge: 1000}
);
}
else if(weatherprov=="owm") {
console.log("Ready from OWM");
navigator.geolocation.getCurrentPosition(
locationSuccessOWM,
locationError,
{enableHighAccuracy:true,timeout: 15000, maximumAge: 1000}
);
}
else if (weatherprov=="wu"){
console.log("Ready from WU");
navigator.geolocation.getCurrentPosition(
locationSuccessWU,
locationError,
{enableHighAccuracy:true,timeout: 15000, maximumAge: 1000}
);
}
}


function getWeatherNow() {
Expand Down

0 comments on commit 3550475

Please sign in to comment.