Fix ViewMode related bugs:

- The user will no longer lost their 'ViewMode' option after being updated in the settings.
- The console will not output errors due tot he scroll function when Mosaic mode is on.
This commit is contained in:
Henrique Dias
2017-10-31 18:23:31 +00:00
parent cc5f3ac1dd
commit 51104c5ee7
7 changed files with 290 additions and 2612 deletions

View File

@@ -160,6 +160,11 @@ func usersPostHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (in
u.Rules = []*fm.Rule{}
}
// If the view mode is empty, initialize with the default one.
if u.ViewMode == "" {
u.ViewMode = c.DefaultUser.ViewMode
}
// Initialize commands if not initialized.
if u.Commands == nil {
u.Commands = []string{}