Skip to content

Commit

Permalink
Prevent people from losing their account
Browse files Browse the repository at this point in the history
Prompt people to bookmark the app/page or else they will lose their tracker.
  • Loading branch information
francois committed Aug 15, 2016
1 parent d9710b3 commit c7d8972
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions public/js/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,19 @@ NoFrillsSleepTracker.renderAppAwake = function(rootNode, store, userId, sleepTab
row.appendChild(cell1);
row.appendChild(cell2);
rootNode.appendChild(row);
if (sleepTable.every(function(el) { return el.utc_duration <= "00h05m"})) {
rootNode.appendChild(NoFrillsSleepTracker.renderBookmarkPrompt());
}

rootNode.appendChild(NoFrillsSleepTracker.renderSleepTable(sleepTable));
}

NoFrillsSleepTracker.renderBookmarkPrompt = function() {
var p = document.createElement("p");
p.appendChild(document.createTextNode("Bookmark this page, either on your Home Screen or as a simple bookmark, to remember your personal tracker. There is no way to recover this page if you lose it."));
return p;
}

NoFrillsSleepTracker.renderAppSleeping = function(rootNode, store, userId, sleepTable) {
var state = document.createElement("p");
state.innerHTML = "";
Expand Down

0 comments on commit c7d8972

Please sign in to comment.