mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-25 01:33:58 +03:00
Fix for anonymous users to switch views
This commit is contained in:
parent
fc3ed8a1de
commit
7b75d93f3d
@ -23,14 +23,16 @@ func SetEditorconfigIfExists(ctx *context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SetDiffViewStyle(ctx *context.Context) {
|
func SetDiffViewStyle(ctx *context.Context) {
|
||||||
|
queryStyle := ctx.Query("style")
|
||||||
|
|
||||||
if !ctx.IsSigned {
|
if !ctx.IsSigned {
|
||||||
|
ctx.Data["IsSplitStyle"] = queryStyle == "split"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
userStyle = ctx.User.DiffViewStyle
|
userStyle = ctx.User.DiffViewStyle
|
||||||
queryStyle = ctx.Query("style")
|
style string
|
||||||
style string
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if queryStyle == "unified" || queryStyle == "split" {
|
if queryStyle == "unified" || queryStyle == "split" {
|
||||||
|
Loading…
Reference in New Issue
Block a user