[API] Fix sync error in case of an internal, handled error.

This commit is contained in:
Kuba Szczodrzyński 2020-02-21 20:41:57 +01:00
parent 43ed621879
commit d2f14093ec
6 changed files with 18 additions and 12 deletions

View File

@ -27,8 +27,9 @@ class EdudziennikData(val data: DataEdudziennik, val onSuccess: () -> Unit) {
onSuccess() onSuccess()
return return
} }
useEndpoint(data.targetEndpointIds.firstKey()) { endpointId -> val id = data.targetEndpointIds.firstKey()
data.targetEndpointIds.remove(endpointId) data.targetEndpointIds.remove(id)
useEndpoint(id) { endpointId ->
data.progress(data.progressStep) data.progress(data.progressStep)
nextEndpoint(onSuccess) nextEndpoint(onSuccess)
} }

View File

@ -30,8 +30,9 @@ class IdziennikData(val data: DataIdziennik, val onSuccess: () -> Unit) {
onSuccess() onSuccess()
return return
} }
useEndpoint(data.targetEndpointIds.firstKey()) { endpointId -> val id = data.targetEndpointIds.firstKey()
data.targetEndpointIds.remove(endpointId) data.targetEndpointIds.remove(id)
useEndpoint(id) { endpointId ->
data.progress(data.progressStep) data.progress(data.progressStep)
nextEndpoint(onSuccess) nextEndpoint(onSuccess)
} }

View File

@ -31,8 +31,9 @@ class LibrusData(val data: DataLibrus, val onSuccess: () -> Unit) {
onSuccess() onSuccess()
return return
} }
useEndpoint(data.targetEndpointIds.firstKey()) { endpointId -> val id = data.targetEndpointIds.firstKey()
data.targetEndpointIds.remove(endpointId) data.targetEndpointIds.remove(id)
useEndpoint(id) { endpointId ->
data.progress(data.progressStep) data.progress(data.progressStep)
nextEndpoint(onSuccess) nextEndpoint(onSuccess)
} }

View File

@ -29,8 +29,9 @@ class MobidziennikData(val data: DataMobidziennik, val onSuccess: () -> Unit) {
onSuccess() onSuccess()
return return
} }
useEndpoint(data.targetEndpointIds.firstKey()) { endpointId -> val id = data.targetEndpointIds.firstKey()
data.targetEndpointIds.remove(endpointId) data.targetEndpointIds.remove(id)
useEndpoint(id) { endpointId ->
data.progress(data.progressStep) data.progress(data.progressStep)
nextEndpoint(onSuccess) nextEndpoint(onSuccess)
} }

View File

@ -32,8 +32,9 @@ class TemplateData(val data: DataTemplate, val onSuccess: () -> Unit) {
onSuccess() onSuccess()
return return
} }
useEndpoint(data.targetEndpointIds.firstKey()) { endpointId -> val id = data.targetEndpointIds.firstKey()
data.targetEndpointIds.remove(endpointId) data.targetEndpointIds.remove(id)
useEndpoint(id) { endpointId ->
data.progress(data.progressStep) data.progress(data.progressStep)
nextEndpoint(onSuccess) nextEndpoint(onSuccess)
} }

View File

@ -27,8 +27,9 @@ class VulcanData(val data: DataVulcan, val onSuccess: () -> Unit) {
onSuccess() onSuccess()
return return
} }
useEndpoint(data.targetEndpointIds.firstKey()) { endpointId -> val id = data.targetEndpointIds.firstKey()
data.targetEndpointIds.remove(endpointId) data.targetEndpointIds.remove(id)
useEndpoint(id) { endpointId ->
data.progress(data.progressStep) data.progress(data.progressStep)
nextEndpoint(onSuccess) nextEndpoint(onSuccess)
} }