Skip to content

Commit f99b925

Browse files
committed
remove
1 parent 8d56251 commit f99b925

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

modules/templates/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func userThemeName(ctx context.Context, user *user_model.User) string {
267267
if user == nil || user.Theme == "" {
268268
return setting.UI.DefaultTheme
269269
}
270-
if webtheme.IsThemeAvailable(ctx, user.Theme) {
270+
if webtheme.IsThemeAvailable(user.Theme) {
271271
return user.Theme
272272
}
273273
return setting.UI.DefaultTheme

routers/web/user/setting/profile.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ func Appearance(ctx *context.Context) {
339339
ctx.Data["Title"] = ctx.Tr("settings.appearance")
340340
ctx.Data["PageIsSettingsAppearance"] = true
341341

342-
allThemes := webtheme.GetAvailableThemes(ctx)
343-
if webtheme.IsThemeAvailable(ctx, setting.UI.DefaultTheme) {
342+
allThemes := webtheme.GetAvailableThemes()
343+
if webtheme.IsThemeAvailable(setting.UI.DefaultTheme) {
344344
allThemes = util.SliceRemoveAll(allThemes, setting.UI.DefaultTheme)
345345
allThemes = append([]string{setting.UI.DefaultTheme}, allThemes...) // move the default theme to the top
346346
}
@@ -374,7 +374,7 @@ func UpdateUIThemePost(ctx *context.Context) {
374374
return
375375
}
376376

377-
if !webtheme.IsThemeAvailable(ctx, form.Theme) {
377+
if !webtheme.IsThemeAvailable(form.Theme) {
378378
ctx.Flash.Error(ctx.Tr("settings.theme_update_error"))
379379
ctx.Redirect(setting.AppSubURL + "/user/settings/appearance")
380380
return

services/webtheme/webtheme.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package webtheme
55

66
import (
7-
"context"
87
"sort"
98
"strings"
109
"sync"
@@ -64,12 +63,12 @@ func initThemes() {
6463
}
6564
}
6665

67-
func GetAvailableThemes(ctx context.Context) []string {
66+
func GetAvailableThemes() []string {
6867
themeOnce.Do(initThemes)
6968
return availableThemes
7069
}
7170

72-
func IsThemeAvailable(ctx context.Context, name string) bool {
71+
func IsThemeAvailable(name string) bool {
7372
themeOnce.Do(initThemes)
7473
return availableThemesSet.Contains(name)
7574
}

templates/user/settings/appearance.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<label>{{ctx.Locale.Tr "settings.ui"}}</label>
1919
<select name="theme" class="ui dropdown">
2020
{{range $theme := .AllThemes}}
21-
<option value="{{$theme}}" {{Iif (eq ($.SignedUser.GetTheme ctx) $theme) "selected"}}>{{$theme}}</option>
21+
<option value="{{$theme}}" {{Iif (eq $.SignedUser.Theme $theme) "selected"}}>{{$theme}}</option>
2222
{{end}}
2323
</select>
2424
</div>

0 commit comments

Comments
 (0)