fix tree cache

This commit is contained in:
Umputun
2018-01-02 12:23:49 -06:00
parent 66df4a6d21
commit b0d5e78662
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ _instructions for google oauth2 setup borrowed from [oauth2_proxy](https://githu
1. Set **"Display Name"** and **"Contact email"**
1. Choose **"Facebook Login"** and then **"Web"**
1. Set "Site URL" to your domain, ex: `https://remark42.mysite.com`
1. Under **"Facebook"/"Settings"** fill "Valid OAuth redirect URIs" with your callback url constructed as domain + `/auth/facebook/callback`
1. Under **"Facebook login"** / **"Settings"** fill "Valid OAuth redirect URIs" with your callback url constructed as domain + `/auth/facebook/callback`
1. Select **"App Review"** and turn public flag on. This step may ask you to provide a link to your privacy policy.
### Frontend
+3 -2
View File
@@ -187,8 +187,9 @@ func (s *Server) findCommentsCtrl(w http.ResponseWriter, r *http.Request) {
comments = s.mod.maskBlockedUsers(comments)
if r.URL.Query().Get("format") == "tree" {
s.respCache.Set(cacheKey, comments, time.Hour)
renderJSONWithHTML(w, r, format.MakeTree(comments, r.URL.Query().Get("sort")))
treeComments := format.MakeTree(comments, r.URL.Query().Get("sort"))
s.respCache.Set(cacheKey, treeComments, time.Hour)
renderJSONWithHTML(w, r, treeComments)
return
}