Ensure api version has been fetched before checking.

This commit is contained in:
davidoskky 2021-03-21 11:44:26 +01:00
parent 9b372a45ce
commit 1f20e19a97

View File

@ -197,10 +197,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
getApiMajorVersion() getApiMajorVersion()
if (apiVersionMajor > 2) {
dateTimeFormatter = "yyyy-MM-dd'T'HH:mm:ssXXX"
}
getElementsAccordingToTab() getElementsAccordingToTab()
} }
@ -426,6 +422,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
override fun onResponse(call: Call<ApiVersion>, response: Response<ApiVersion>) { override fun onResponse(call: Call<ApiVersion>, response: Response<ApiVersion>) {
val version = response.body() as ApiVersion val version = response.body() as ApiVersion
apiVersionMajor = version.getApiMajorVersion() apiVersionMajor = version.getApiMajorVersion()
if (apiVersionMajor > 2) {
dateTimeFormatter = "yyyy-MM-dd'T'HH:mm:ssXXX"
}
} }
}) })