0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 03:04:23 +01:00

Fix for anonymous users to switch views

This commit is contained in:
Bwko 2016-11-19 16:53:34 +01:00 committed by GitHub
parent fc3ed8a1de
commit 7b75d93f3d

View file

@ -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" {