Browse Source

Fix for anonymous users to switch views

tags/v1.2.0-rc1
Bwko GitHub 9 years ago
parent
commit
9e97dc1cd9
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      routers/repo/middlewares.go

+ 5
- 3
routers/repo/middlewares.go 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" {


Loading…
Cancel
Save