Skip to content

Commit

Permalink
🐛 Removed code duplicated about checking current deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
keelus committed Jul 29, 2023
1 parent 0c3d812 commit ada0204
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/handlers/apiHandler/ledHandler/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func Delete(c *gin.Context) {
c.Status(http.StatusOK)
return
}

hex := c.PostForm("hexValue")
switch mode {
case "StaticColor":
Expand All @@ -180,10 +181,6 @@ func Delete(c *gin.Context) {
}
}

if config.LedActive.Color[0] == hex {
config.LedActive.Color[0] = newPreset[0]
}

config.LedPresets.StaticColor = newPreset

if config.LedActive.Color[0] == hex { // If we delete hex that is currently activated, activate first
Expand Down

0 comments on commit ada0204

Please sign in to comment.