Skip to content

Commit

Permalink
journal-gateway: use localStorage["cursor"] only when it has valid value
Browse files Browse the repository at this point in the history
Discovered by LGTM.

(cherry picked from commit 944072f)
  • Loading branch information
yuwata authored and keszybz committed Oct 29, 2018
1 parent 6dfae27 commit 4617d27
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/journal-remote/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,12 @@ <h1 id="title"></h1>

function entriesLoad(range) {

if (range == null)
range = localStorage["cursor"] + ":0";
if (range == null)
range = "";
if (range == null) {
if (localStorage["cursor"] != null && localStorage["cursor"] != "")
range = localStorage["cursor"] + ":0";
else
range = "";
}

var url = "/entries";

Expand Down

0 comments on commit 4617d27

Please sign in to comment.