Ganfra's review: revert change
This commit is contained in:
parent
fa297a7b6a
commit
9772bbe157
|
@ -35,7 +35,6 @@ class RealmQueryLatch<E : RealmObject>(private val realmConfiguration: RealmConf
|
||||||
val realm = Realm.getInstance(realmConfiguration)
|
val realm = Realm.getInstance(realmConfiguration)
|
||||||
val result = realmQueryBuilder(realm).findAllAsync()
|
val result = realmQueryBuilder(realm).findAllAsync()
|
||||||
|
|
||||||
if (result.isEmpty()) {
|
|
||||||
result.addChangeListener(object : RealmChangeListener<RealmResults<E>> {
|
result.addChangeListener(object : RealmChangeListener<RealmResults<E>> {
|
||||||
override fun onChange(t: RealmResults<E>) {
|
override fun onChange(t: RealmResults<E>) {
|
||||||
if (t.isNotEmpty()) {
|
if (t.isNotEmpty()) {
|
||||||
|
@ -45,10 +44,6 @@ class RealmQueryLatch<E : RealmObject>(private val realmConfiguration: RealmConf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
realm.close()
|
|
||||||
latch.countDown()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
handler.post(runnable)
|
handler.post(runnable)
|
||||||
latch.await()
|
latch.await()
|
||||||
|
|
Loading…
Reference in New Issue