don't override other options with default values when updating

This commit is contained in:
Ted Unangst 2019-11-23 16:57:28 -05:00
parent d200046210
commit 2e0bf0147a
1 changed files with 6 additions and 1 deletions

7
web.go
View File

@ -1064,13 +1064,18 @@ func honkpage(w http.ResponseWriter, u *login.UserInfo, honks []*Honk, templinfo
func saveuser(w http.ResponseWriter, r *http.Request) { func saveuser(w http.ResponseWriter, r *http.Request) {
whatabout := r.FormValue("whatabout") whatabout := r.FormValue("whatabout")
u := login.GetUserInfo(r) u := login.GetUserInfo(r)
user, _ := butwhatabout(u.Username)
db := opendatabase() db := opendatabase()
var options UserOptions options := user.Options
if r.FormValue("skinny") == "skinny" { if r.FormValue("skinny") == "skinny" {
options.SkinnyCSS = true options.SkinnyCSS = true
} else {
options.SkinnyCSS = false
} }
if r.FormValue("maps") == "apple" { if r.FormValue("maps") == "apple" {
options.MapLink = "apple" options.MapLink = "apple"
} else {
options.MapLink = ""
} }
j, err := jsonify(options) j, err := jsonify(options)
if err == nil { if err == nil {