feat: success message indicator, better UX for image toggling

This commit is contained in:
httpjamesm
2022-12-29 13:52:17 -05:00
parent 4ddc1a2af7
commit 0e9677ec61
3 changed files with 31 additions and 13 deletions

View File

@ -18,7 +18,11 @@ func ChangeOptions(c *gin.Context) {
text = "enabled"
}
c.SetCookie("disable_images", fmt.Sprintf("%t", !c.MustGet("disable_images").(bool)), 60*60*24*365*10, "/", "", false, true)
c.String(200, "Images are now %s", text)
c.HTML(200, "home.html", gin.H{
"successMessage": "Images are now " + text,
"theme": c.MustGet("theme").(string),
})
case "theme":
text := "dark"
if c.MustGet("theme").(string) == "dark" {