[API] Fix doubled sync on API error.

This commit is contained in:
Kuba Szczodrzyński 2020-08-24 18:56:26 +02:00
parent 300e2c4bc2
commit 33a8fa2a1e
8 changed files with 2 additions and 7 deletions

View File

@ -25,6 +25,7 @@ import pl.szczodrzynski.edziennik.data.db.entity.Teacher
import pl.szczodrzynski.edziennik.data.db.full.AnnouncementFull
import pl.szczodrzynski.edziennik.data.db.full.EventFull
import pl.szczodrzynski.edziennik.data.db.full.MessageFull
import pl.szczodrzynski.edziennik.utils.Utils.d
open class EdziennikTask(override val profileId: Int, val request: Any) : IApiTask(profileId) {
companion object {
@ -108,6 +109,7 @@ open class EdziennikTask(override val profileId: Int, val request: Any) : IApiTa
}
override fun cancel() {
d(TAG, "Task ${toString()} cancelling...")
edziennikInterface?.cancel()
}

View File

@ -110,7 +110,6 @@ class Edudziennik(val app: App, val profile: Profile?, val loginStore: LoginStor
override fun cancel() {
d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {

View File

@ -133,7 +133,6 @@ class Idziennik(val app: App, val profile: Profile?, val loginStore: LoginStore,
override fun cancel() {
d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {

View File

@ -157,7 +157,6 @@ class Librus(val app: App, val profile: Profile?, val loginStore: LoginStore, va
override fun cancel() {
d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {

View File

@ -130,7 +130,6 @@ class Mobidziennik(val app: App, val profile: Profile?, val loginStore: LoginSto
override fun cancel() {
d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {

View File

@ -134,7 +134,6 @@ class Podlasie(val app: App, val profile: Profile?, val loginStore: LoginStore,
override fun cancel() {
Utils.d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {

View File

@ -100,7 +100,6 @@ class Template(val app: App, val profile: Profile?, val loginStore: LoginStore,
override fun cancel() {
d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {

View File

@ -194,7 +194,6 @@ class Vulcan(val app: App, val profile: Profile?, val loginStore: LoginStore, va
override fun cancel() {
d(TAG, "Cancelled")
data.cancel()
callback.onCompleted()
}
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {