Make sure we have contacts permission before trying to sync

This commit is contained in:
Moez Bhatti
2020-01-01 15:49:47 -05:00
parent 3b50aff58c
commit c3186fa2f7
@@ -113,10 +113,12 @@ class MainViewModel @Inject constructor(
}
// Sync contacts when we detect a change
disposables += contactAddedListener.listen()
.debounce(1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.io())
.subscribe { syncContacts.execute(Unit) }
if (permissionManager.hasContacts()) {
disposables += contactAddedListener.listen()
.debounce(1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.io())
.subscribe { syncContacts.execute(Unit) }
}
ratingManager.addSession()
markAllSeen.execute(Unit)