diff --git a/handlers/routes.go b/handlers/routes.go index 1ed2da8..b84a0a4 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -12,5 +12,8 @@ func SetupRoutes(router *http.ServeMux, sse *sse.Server, appHandler *AppHandler) fsAssets := http.FileServer(http.Dir("assets")) router.Handle("GET /assets/", http.StripPrefix("/assets/", fsAssets)) + icons := http.FileServer(http.Dir("storage/icons")) + router.Handle("GET /icons/", http.StripPrefix("/icons/", icons)) + router.HandleFunc("GET /", appHandler.appHandler) } diff --git a/services/bookmark.services.go b/services/bookmark.services.go index 92dc37b..5b5663b 100644 --- a/services/bookmark.services.go +++ b/services/bookmark.services.go @@ -105,12 +105,6 @@ func (bs *BookmarkService) replaceIconString() { if !(bookmark.IgnoreColor || !ok || color == "") { data = []byte(insertColor(string(data), color)) } - } else if strings.HasPrefix(bookmark.Icon, "di/") { - title := strings.Replace(bookmark.Icon, "di/", "", 1) - data, err = os.ReadFile(simpleIconsFolder + title) - if err != nil { - continue - } } else { data, err = os.ReadFile(iconsFolder + bookmark.Icon) if err != nil { @@ -118,6 +112,8 @@ func (bs *BookmarkService) replaceIconString() { } } bs.bookmarks.Applications[i].Entries[j].Icon = string(data) + } else { + bs.bookmarks.Applications[i].Entries[j].Icon = "" } } }