Fix for anonymous users to switch views

tokarchuk/v1.17
Bwko 8 years ago committed by GitHub
parent fc3ed8a1de
commit 7b75d93f3d
  1. 8
      routers/repo/middlewares.go

@ -23,14 +23,16 @@ func SetEditorconfigIfExists(ctx *context.Context) {
}
func SetDiffViewStyle(ctx *context.Context) {
queryStyle := ctx.Query("style")
if !ctx.IsSigned {
ctx.Data["IsSplitStyle"] = queryStyle == "split"
return
}
var (
userStyle = ctx.User.DiffViewStyle
queryStyle = ctx.Query("style")
style string
userStyle = ctx.User.DiffViewStyle
style string
)
if queryStyle == "unified" || queryStyle == "split" {

Loading…
Cancel
Save