mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-06 17:59:03 +02:00
feat: add ability to search and select icons from selfh.st (#1807)
This commit is contained in:
@@ -79,10 +79,28 @@ func (acc *AppConfigController) listAppConfigHandler(c *gin.Context) error {
|
||||
Value: strconv.FormatBool(tracing.FrontendTracingEnabled()),
|
||||
})
|
||||
|
||||
// Manually add iconLibrary, derived from ICON_LIBRARY_URL, so the frontend can hide the icon picker and only credits selfh.st when its collection is used
|
||||
configVariablesDto = append(configVariablesDto, dto.PublicAppConfigVariableDto{
|
||||
Key: "iconLibrary",
|
||||
Value: iconLibraryStatus(),
|
||||
})
|
||||
|
||||
c.JSON(http.StatusOK, configVariablesDto)
|
||||
return nil
|
||||
}
|
||||
|
||||
// iconLibraryStatus reports whether the icon library is disabled, uses the default selfh.st collection, or points to a custom source
|
||||
func iconLibraryStatus() string {
|
||||
switch common.EnvConfig.IconLibraryURL {
|
||||
case common.IconLibraryDisabled:
|
||||
return "disabled"
|
||||
case common.DefaultIconLibraryURL:
|
||||
return "default"
|
||||
default:
|
||||
return "custom"
|
||||
}
|
||||
}
|
||||
|
||||
// listAllAppConfigHandler godoc
|
||||
// @Summary List all application configurations
|
||||
// @Description Get all application configurations including private ones
|
||||
|
||||
Reference in New Issue
Block a user