corrupted schedule bugfix

This commit is contained in:
Adler Neves 2019-08-08 04:51:58 -03:00
parent eda34bce65
commit 2f6f3a3066
2 changed files with 7 additions and 8 deletions

View File

@ -10,8 +10,8 @@ android {
applicationId "com.adlerosn.brasilfurfest"
minSdkVersion 21
targetSdkVersion 29
versionCode 49
versionName "2019.8.6.3"
versionCode 50
versionName "2019.8.8.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -35,12 +35,11 @@ open class Observable<T : Any?> {
open fun hasChanged() = changed
fun notifyObservers() = notifyObservers(null)
fun notifyObservers(arg: T?) {
doAsync {
if (hasChanged()) {
clearChanged()
observers.forEach {
it.update(this, arg)
}
// Don't do anything async here or you might lose data
if (hasChanged()) {
clearChanged()
observers.forEach {
it.update(this, arg)
}
}
}