Backend update: macro/open endpoint works as intended.

This commit is contained in:
Jesse Malotaux 2025-04-28 13:44:45 +02:00
parent 4789e5d1a9
commit 97af604cb6
2 changed files with 141 additions and 61 deletions

View file

@ -150,5 +150,14 @@ func OpenMacro(w http.ResponseWriter, r *http.Request) {
return
}
// Walk through the macro file and reverse translate codes
for i, action := range macroFile {
if actionType, ok := action["type"].(string); ok && actionType == "key" {
if code, ok := action["code"].(string); ok {
macroFile[i]["code"] = helper.ReverseTranslate(code)
}
}
}
json.NewEncoder(w).Encode(macroFile)
}