Add dark mode setting storage

pull/816/head
Jordan T 2020-08-19 10:37:25 -05:00
rodzic fb7a09ba3e
commit 463721c93b
2 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -1103,6 +1103,7 @@ func getProductNameFromId(product_id int) string {
}
type settings struct {
DarkMode bool
UAT_Enabled bool
ES_Enabled bool
Ping_Enabled bool
@ -1186,6 +1187,7 @@ var globalSettings settings
var globalStatus status
func defaultSettings() {
globalSettings.DarkMode = false
globalSettings.UAT_Enabled = true
globalSettings.ES_Enabled = true
globalSettings.GPS_Enabled = true

Wyświetl plik

@ -271,6 +271,8 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
for key, val := range msg {
// log.Printf("handleSettingsSetRequest:json: testing for key:%s of type %s\n", key, reflect.TypeOf(val))
switch key {
case "DarkMode":
globalSettings.DarkMode = val.(bool)
case "UAT_Enabled":
globalSettings.UAT_Enabled = val.(bool)
case "ES_Enabled":