From 6f1c2eca125dcdd5371c016f9b516983ed8cf72a Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Sat, 27 Jul 2019 08:48:23 +0300 Subject: [PATCH] Don't omit history index when the value is 0 (#1545) --- services/browsers/api_test.go | 10 ++++++---- services/browsers/database.go | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/services/browsers/api_test.go b/services/browsers/api_test.go index eb23de71eb0..8b83b63bec3 100644 --- a/services/browsers/api_test.go +++ b/services/browsers/api_test.go @@ -44,10 +44,12 @@ func TestBrowsersOrderedNewestFirst(t *testing.T) { Timestamp: 50, }, { - ID: "3", - Name: "third", - Dapp: true, - Timestamp: 100, + ID: "3", + Name: "third", + Dapp: true, + Timestamp: 100, + HistoryIndex: 0, + History: []string{"zero"}, }, } for i := 0; i < len(browsers); i++ { diff --git a/services/browsers/database.go b/services/browsers/database.go index b17871135f4..70a242e481b 100644 --- a/services/browsers/database.go +++ b/services/browsers/database.go @@ -35,7 +35,7 @@ type Browser struct { Name string `json:"name"` Timestamp uint64 `json:"timestamp"` Dapp bool `json:"dapp?"` - HistoryIndex int `json:"history-index,omitempty"` + HistoryIndex int `json:"history-index"` History []string `json:"history,omitempty"` }