diff --git a/appinfo.json b/appinfo.json index 7d7a0f1..f8c1f4e 100644 --- a/appinfo.json +++ b/appinfo.json @@ -54,9 +54,9 @@ "diorite", "emery" ], - "uuid": "133215f0-cf20-4c05-997b-3c9be5a64e5b", + "uuid": "f7db208c-a80b-4bca-b5fd-813f02c5570f", "versionCode": 1, - "versionLabel": "1.0", + "versionLabel": "1.1", "watchapp": { "watchface": false } diff --git a/docs/index.html b/docs/index.html index 6b62d89..952a708 100644 --- a/docs/index.html +++ b/docs/index.html @@ -51,7 +51,10 @@

RSS Feeds

if (hash.feeds.length > 0) { feeds = hash.feeds; } - rss2jsonApiKey = hash.rss2jsonApiKey; + if (typeof hash.rss2jsonApiKey === 'undefined') + { + rss2jsonApiKey = hash.rss2jsonApiKey; + } } document.addEventListener("DOMContentLoaded", function() { diff --git a/src/js/app.js b/src/js/app.js index d98e859..565f4aa 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -37,7 +37,7 @@ var defaultFeeds = [{ Settings.config({url: 'https://wowfunhappy.github.io/Pebble-RSS-Reader/', hash: true}, function(){ console.log("opened configurable"); - if (Settings.option().feeds.length < 1) { + if (typeof Settings.option().feeds === 'undefined' || Settings.option().feeds.length < 1) { Settings.option("feeds", defaultFeeds); } }, function(){ @@ -51,9 +51,8 @@ selectFeed(); function selectFeed() { /*Overwrite default feeds with what user input in Settings.*/ - if (Settings.option().feeds.length > 0) { + if (typeof Settings.option().feeds !== 'undefined' && Settings.option().feeds.length > 0) { feeds = Settings.option().feeds; - console.log("Opened configurable"); } else { feeds = defaultFeeds; @@ -83,10 +82,13 @@ function getArticles(feed) { loadingCard.show(); articleList = []; jsonUrl = "https://api.rss2json.com/v1/api.json?rss_url=" + feed.url; - rss2jsonApiKey = Settings.option().rss2jsonApiKey; - if (rss2jsonApiKey !== "") { + + var rss2jsonApiKey = ""; + if (typeof Settings.option().rss2jsonApiKey !== 'undefined') { + rss2jsonApiKey = Settings.option().rss2jsonApiKey; jsonUrl = jsonUrl + "&api_key=" + rss2jsonApiKey + "&count=100"; } + ajax({ url: jsonUrl }, function(json) { json = JSON.parse(json); if (json.status === "ok" && !shouldCancel) {