aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-04-19 18:56:36 +0300
committerTulir Asokan <tulir@maunium.net>2020-04-19 18:57:11 +0300
commitc4175bfa703ef299938a10ca8ed50be35c873632 (patch)
treeaa8a547d1cb5d898b4759b7efb29d5f9db3849f7 /matrix
parent0943374892197dbeaaa591705a6c81df16a73fb8 (diff)
Only show syncing modal for initial syncs
Diffstat (limited to 'matrix')
-rw-r--r--matrix/matrix.go15
-rw-r--r--matrix/sync.go2
2 files changed, 11 insertions, 6 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index b360c56..617bbd5 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -331,12 +331,15 @@ func (c *Container) OnLogin() {
c.syncer.OnEventType(event.AccountDataPushRules, c.HandlePushRules)
c.syncer.OnEventType(event.AccountDataRoomTags, c.HandleTag)
c.syncer.OnEventType(AccountDataGomuksPreferences, c.HandlePreferences)
- c.syncer.Progress = c.ui.MainView().OpenSyncingModal()
- c.syncer.Progress.SetMessage("Waiting for /sync response from server")
- c.syncer.Progress.SetIndeterminate()
- c.syncer.FirstDoneCallback = func() {
- c.syncer.Progress.Close()
- c.syncer.Progress = StubSyncingModal{}
+ if len(c.config.AuthCache.NextBatch) == 0 {
+ c.syncer.Progress = c.ui.MainView().OpenSyncingModal()
+ c.syncer.Progress.SetMessage("Waiting for /sync response from server")
+ c.syncer.Progress.SetIndeterminate()
+ c.syncer.FirstDoneCallback = func() {
+ c.syncer.Progress.Close()
+ c.syncer.Progress = StubSyncingModal{}
+ c.syncer.FirstDoneCallback = nil
+ }
}
c.syncer.InitDoneCallback = func() {
debug.Print("Initial sync done")
diff --git a/matrix/sync.go b/matrix/sync.go
index fdf2d4b..85de68c 100644
--- a/matrix/sync.go
+++ b/matrix/sync.go
@@ -99,6 +99,7 @@ func NewGomuksSyncer(rooms *rooms.RoomCache) *GomuksSyncer {
rooms: rooms,
listeners: make(map[event.Type][]EventHandler),
FirstSyncDone: false,
+ Progress: StubSyncingModal{},
}
}
@@ -138,6 +139,7 @@ func (s *GomuksSyncer) ProcessResponse(res *mautrix.RespSync, since string) (err
}
wait.Wait()
+ s.Progress.SetMessage("Finishing sync")
if since == "" && s.InitDoneCallback != nil {
s.InitDoneCallback()