Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 816118fc authored by Moez Bhatti's avatar Moez Bhatti Committed by Dayona Joseph
Browse files

Make sure we have contacts permission before trying to sync

parent 6189453b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -107,10 +107,12 @@ class MainViewModel @Inject constructor(
        }

        // Sync contacts when we detect a change
        if (permissionManager.hasContacts()) {
            disposables += contactAddedListener.listen()
                    .debounce(1, TimeUnit.SECONDS)
                    .subscribeOn(Schedulers.io())
                    .subscribe { syncContacts.execute(Unit) }
        }
        markAllSeen.execute(Unit)
    }