Skip to content

Commit dd7a97e

Browse files
committed
fix app sub url, add comments
1 parent 139e2a8 commit dd7a97e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

services/webtheme/webtheme.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,16 @@ func GetThemeMetaInfo(internalName string) *ThemeMetaInfo {
186186
return availableThemeMap[internalName]
187187
}
188188

189+
// GuaranteeGetThemeMetaInfo guarantees to return a non-nil ThemeMetaInfo,
190+
// to simplify the caller's logic, especially for templates.
191+
// There are already enough warnings messages if the default theme is not available.
189192
func GuaranteeGetThemeMetaInfo(internalName string) *ThemeMetaInfo {
190193
info := GetThemeMetaInfo(internalName)
191194
if info == nil {
192195
info = GetThemeMetaInfo(setting.UI.DefaultTheme)
193196
}
194197
if info == nil {
195-
info = &ThemeMetaInfo{}
198+
info = &ThemeMetaInfo{DisplayName: "unavailable", InternalName: "unavailable", FileName: "unavailable"}
196199
}
197200
return info
198201
}

web_src/js/features/common-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function initFooterThemeSelector() {
3636
const $dropdown = fomanticQuery(elDropdown);
3737
$dropdown.dropdown({
3838
direction: 'upward',
39-
apiSettings: {url: '/-/web-theme/list', cache: false},
39+
apiSettings: {url: `${appSubUrl}/-/web-theme/list`, cache: false},
4040
});
4141
addDelegatedEventListener(elDropdown, 'click', '.menu > .item', async (el) => {
4242
const themeName = el.getAttribute('data-value');

0 commit comments

Comments
 (0)