Skip to content

Commit

Permalink
Adding some logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
matopeto committed Dec 12, 2016
1 parent c84db59 commit c92d48f
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions src/js/tools/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,41 @@ function formatDistance(distance) {

function setApplicationSubtitle(subtitle) {
if (!Pebble.appGlanceReload) {
console.log("appGlanceReload is not supported");
return;
}

var appGlanceSlices = [{
"layout": {
"subtitleTemplateString": subtitle,
},
}];
console.log("setApplicationSubtitle:");

Pebble.appGlanceReload(appGlanceSlices, null, null);
Pebble.appGlanceReload(
[{
layout: {
subtitleTemplateString: subtitle,
},
}],function (appGlanceSlices) {
console.log('AppGlanceReload is successful');
},
function (appGlanceSlices) {
console.log('AppGlanceReload has failed');
});
}

function clearApplicatioSubtitle() {
if (!Pebble.appGlanceReload) {
console.log("appGlanceReload is not supported");
return;
}

Pebble.appGlanceReload([], null, null);
console.log("clearApplicatioSubtitle");

Pebble.appGlanceReload(
[],
function (appGlanceSlices) {
console.log('AppGlanceReload is successful');
},
function (appGlanceSlices) {
console.log('AppGlanceReload has failed');
}
);
}

module.exports = {
Expand Down

0 comments on commit c92d48f

Please sign in to comment.