mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 05:56:14 +01:00
Fix for anonymous users to switch views
This commit is contained in:
parent
fc3ed8a1de
commit
7b75d93f3d
1 changed files with 5 additions and 3 deletions
|
@ -23,13 +23,15 @@ 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
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue