88 "strings"
99 "sync"
1010
11- "code.gitea.io/gitea/modules/container"
1211 "code.gitea.io/gitea/modules/log"
1312 "code.gitea.io/gitea/modules/setting/config"
1413)
@@ -71,10 +70,6 @@ type UIStruct struct {
7170 DefaultShowFullName * config.Value [bool ]
7271 DefaultTheme * config.Value [string ]
7372 Themes * config.Value [[]string ]
74- Reactions * config.Value [[]string ]
75- ReactionsLookup container.Set [string ]
76- CustomEmojis * config.Value [[]string ]
77- CustomEmojisMap map [string ]string
7873 SearchRepoDescription * config.Value [bool ]
7974 OnlyShowRelevantRepos * config.Value [bool ]
8075 ExploreDefaultSort * config.Value [string ]
@@ -83,19 +78,11 @@ type UIStruct struct {
8378}
8479
8580func (u * UIStruct ) ToStruct (ctx context.Context ) UIForm {
86- var themes , reactions , customEmojis string
81+ var themes string
8782 for _ , v := range u .Themes .Value (ctx ) {
8883 themes += v + ","
8984 }
9085 themes = strings .TrimSuffix (themes , "," )
91- for _ , v := range u .Reactions .Value (ctx ) {
92- reactions += v + ","
93- }
94- reactions = strings .TrimSuffix (reactions , "," )
95- for _ , v := range u .CustomEmojis .Value (ctx ) {
96- customEmojis += v + ","
97- }
98- customEmojis = strings .TrimSuffix (customEmojis , "," )
9986 return UIForm {
10087 ExplorePagingNum : u .ExplorePagingNum .Value (ctx ),
10188 SitemapPagingNum : u .SitemapPagingNum .Value (ctx ),
@@ -113,8 +100,6 @@ func (u *UIStruct) ToStruct(ctx context.Context) UIForm {
113100 DefaultShowFullName : u .DefaultShowFullName .Value (ctx ),
114101 DefaultTheme : u .DefaultTheme .Value (ctx ),
115102 Themes : themes ,
116- Reactions : reactions ,
117- CustomEmojis : customEmojis ,
118103 SearchRepoDescription : u .SearchRepoDescription .Value (ctx ),
119104 OnlyShowRelevantRepos : u .OnlyShowRelevantRepos .Value (ctx ),
120105 ExplorePagingDefaultSort : u .ExploreDefaultSort .Value (ctx ),
@@ -142,8 +127,6 @@ type UIForm struct {
142127 DefaultShowFullName bool
143128 DefaultTheme string
144129 Themes string
145- Reactions string
146- CustomEmojis string
147130 SearchRepoDescription bool
148131 OnlyShowRelevantRepos bool
149132 ExplorePagingDefaultSort string
@@ -191,8 +174,6 @@ func initDefaultConfig() {
191174 DefaultShowFullName : config.ValueJSON [bool ]("ui.default_show_full_name" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "DEFAULT_SHOW_FULL_NAME" }),
192175 DefaultTheme : config.ValueJSON [string ]("ui.default_theme" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "DEFAULT_THEME" }),
193176 Themes : config.ValueJSON [[]string ]("ui.themes" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "THEMES" }),
194- Reactions : config.ValueJSON [[]string ]("ui.reactions" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "REACTIONS" }),
195- CustomEmojis : config.ValueJSON [[]string ]("ui.custom_emojis" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "CUSTOM_EMOJIS" }),
196177 SearchRepoDescription : config.ValueJSON [bool ]("ui.search_repo_description" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "SEARCH_REPO_DESCRIPTION" }),
197178 OnlyShowRelevantRepos : config.ValueJSON [bool ]("ui.only_show_relevant_repos" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "ONLY_SHOW_RELEVANT_REPOS" }),
198179 ExploreDefaultSort : config.ValueJSON [string ]("ui.explore_paging_default_sort" ).WithFileConfig (config.CfgSecKey {Sec : "ui" , Key : "EXPLORE_PAGING_DEFAULT_SORT" }),
@@ -204,15 +185,6 @@ func initDefaultConfig() {
204185
205186func Config () * ConfigStruct {
206187 defaultConfigOnce .Do (initDefaultConfig )
207- ctx := context .Background ()
208- defaultConfig .UI .ReactionsLookup = make (container.Set [string ])
209- for _ , reaction := range defaultConfig .UI .Reactions .Value (ctx ) {
210- defaultConfig .UI .ReactionsLookup .Add (reaction )
211- }
212- defaultConfig .UI .CustomEmojisMap = make (map [string ]string )
213- for _ , emoji := range defaultConfig .UI .CustomEmojis .Value (ctx ) {
214- defaultConfig .UI .CustomEmojisMap [emoji ] = ":" + emoji + ":"
215- }
216188 return defaultConfig
217189}
218190
0 commit comments