Load config before initializing UI

Otherwise the user ID/homeserver values are ignored even though they're
supposed to be prefilled in the UI.
Thanks to @jevolk for noticing the mistake.
This commit is contained in:
Tulir Asokan 2018-05-16 21:58:04 +03:00
parent d6396bc02a
commit a1f9ee23fa

View File

@ -49,11 +49,12 @@ func NewGomuks(uiProvider ifc.UIProvider) *Gomuks {
gmx.config = config.NewConfig(configDir, cacheDir) gmx.config = config.NewConfig(configDir, cacheDir)
gmx.ui = uiProvider(gmx) gmx.ui = uiProvider(gmx)
gmx.matrix = matrix.NewContainer(gmx) gmx.matrix = matrix.NewContainer(gmx)
gmx.config.Load()
gmx.ui.Init() gmx.ui.Init()
debug.OnRecover = gmx.ui.Finish debug.OnRecover = gmx.ui.Finish
gmx.config.Load()
if len(gmx.config.UserID) > 0 { if len(gmx.config.UserID) > 0 {
_ = gmx.config.LoadSession(gmx.config.UserID) _ = gmx.config.LoadSession(gmx.config.UserID)
} }