summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/repo/middlewares.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/routers/repo/middlewares.go b/routers/repo/middlewares.go
index b16b003cfe..11b0009dbf 100644
--- a/routers/repo/middlewares.go
+++ b/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" {