mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 05:48:19 +01:00
[API] Fix doubled sync on API error.
This commit is contained in:
parent
300e2c4bc2
commit
33a8fa2a1e
@ -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.AnnouncementFull
|
||||||
import pl.szczodrzynski.edziennik.data.db.full.EventFull
|
import pl.szczodrzynski.edziennik.data.db.full.EventFull
|
||||||
import pl.szczodrzynski.edziennik.data.db.full.MessageFull
|
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) {
|
open class EdziennikTask(override val profileId: Int, val request: Any) : IApiTask(profileId) {
|
||||||
companion object {
|
companion object {
|
||||||
@ -108,6 +109,7 @@ open class EdziennikTask(override val profileId: Int, val request: Any) : IApiTa
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
|
d(TAG, "Task ${toString()} cancelling...")
|
||||||
edziennikInterface?.cancel()
|
edziennikInterface?.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,6 @@ class Edudziennik(val app: App, val profile: Profile?, val loginStore: LoginStor
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
d(TAG, "Cancelled")
|
d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
@ -133,7 +133,6 @@ class Idziennik(val app: App, val profile: Profile?, val loginStore: LoginStore,
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
d(TAG, "Cancelled")
|
d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
@ -157,7 +157,6 @@ class Librus(val app: App, val profile: Profile?, val loginStore: LoginStore, va
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
d(TAG, "Cancelled")
|
d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
@ -130,7 +130,6 @@ class Mobidziennik(val app: App, val profile: Profile?, val loginStore: LoginSto
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
d(TAG, "Cancelled")
|
d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
@ -134,7 +134,6 @@ class Podlasie(val app: App, val profile: Profile?, val loginStore: LoginStore,
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
Utils.d(TAG, "Cancelled")
|
Utils.d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
@ -100,7 +100,6 @@ class Template(val app: App, val profile: Profile?, val loginStore: LoginStore,
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
d(TAG, "Cancelled")
|
d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
@ -194,7 +194,6 @@ class Vulcan(val app: App, val profile: Profile?, val loginStore: LoginStore, va
|
|||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
d(TAG, "Cancelled")
|
d(TAG, "Cancelled")
|
||||||
data.cancel()
|
data.cancel()
|
||||||
callback.onCompleted()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
private fun wrapCallback(callback: EdziennikCallback): EdziennikCallback {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user