Only show syncing modal for initial syncs
This commit is contained in:
parent
0943374892
commit
c4175bfa70
@ -331,12 +331,15 @@ func (c *Container) OnLogin() {
|
|||||||
c.syncer.OnEventType(event.AccountDataPushRules, c.HandlePushRules)
|
c.syncer.OnEventType(event.AccountDataPushRules, c.HandlePushRules)
|
||||||
c.syncer.OnEventType(event.AccountDataRoomTags, c.HandleTag)
|
c.syncer.OnEventType(event.AccountDataRoomTags, c.HandleTag)
|
||||||
c.syncer.OnEventType(AccountDataGomuksPreferences, c.HandlePreferences)
|
c.syncer.OnEventType(AccountDataGomuksPreferences, c.HandlePreferences)
|
||||||
c.syncer.Progress = c.ui.MainView().OpenSyncingModal()
|
if len(c.config.AuthCache.NextBatch) == 0 {
|
||||||
c.syncer.Progress.SetMessage("Waiting for /sync response from server")
|
c.syncer.Progress = c.ui.MainView().OpenSyncingModal()
|
||||||
c.syncer.Progress.SetIndeterminate()
|
c.syncer.Progress.SetMessage("Waiting for /sync response from server")
|
||||||
c.syncer.FirstDoneCallback = func() {
|
c.syncer.Progress.SetIndeterminate()
|
||||||
c.syncer.Progress.Close()
|
c.syncer.FirstDoneCallback = func() {
|
||||||
c.syncer.Progress = StubSyncingModal{}
|
c.syncer.Progress.Close()
|
||||||
|
c.syncer.Progress = StubSyncingModal{}
|
||||||
|
c.syncer.FirstDoneCallback = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
c.syncer.InitDoneCallback = func() {
|
c.syncer.InitDoneCallback = func() {
|
||||||
debug.Print("Initial sync done")
|
debug.Print("Initial sync done")
|
||||||
|
@ -99,6 +99,7 @@ func NewGomuksSyncer(rooms *rooms.RoomCache) *GomuksSyncer {
|
|||||||
rooms: rooms,
|
rooms: rooms,
|
||||||
listeners: make(map[event.Type][]EventHandler),
|
listeners: make(map[event.Type][]EventHandler),
|
||||||
FirstSyncDone: false,
|
FirstSyncDone: false,
|
||||||
|
Progress: StubSyncingModal{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +139,7 @@ func (s *GomuksSyncer) ProcessResponse(res *mautrix.RespSync, since string) (err
|
|||||||
}
|
}
|
||||||
|
|
||||||
wait.Wait()
|
wait.Wait()
|
||||||
|
s.Progress.SetMessage("Finishing sync")
|
||||||
|
|
||||||
if since == "" && s.InitDoneCallback != nil {
|
if since == "" && s.InitDoneCallback != nil {
|
||||||
s.InitDoneCallback()
|
s.InitDoneCallback()
|
||||||
|
Loading…
Reference in New Issue
Block a user