Skip to content
Snippets Groups Projects
Commit 5545df76 authored by John Carlson's avatar John Carlson
Browse files

Stop build loading before view is destroyed

parent 6a4802c8
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -307,7 +307,7 @@ class LoginActivity : BaseActivity() {
} else {
textInputLayoutUrl.error = null
}
if (url[url.length - 1] != '/') {
if (!url.endsWith("/")) {
textInputLayoutUrl.error = getString(R.string.please_end_your_url_with_a_slash)
return false
} else {
Loading
Loading
@@ -392,9 +392,9 @@ class LoginActivity : BaseActivity() {
d.findViewById<TextView>(android.R.id.message).movementMethod = LinkMovementMethod.getInstance()
} else if (t is SSLPeerUnverifiedException && t.message?.toLowerCase()!!.contains("hostname")) {
account.trustedHostname = null
val hostNameVerifier = gitLab?.client?.hostnameVerifier() as CustomHostnameVerifier
val finalHostname = hostNameVerifier.lastFailedHostname
val d = AlertDialog.Builder(this)
val hostNameVerifier = gitLab?.client?.hostnameVerifier() as? CustomHostnameVerifier
val finalHostname = hostNameVerifier?.lastFailedHostname
val dialog = AlertDialog.Builder(this)
.setTitle(R.string.hostname_title)
.setMessage(R.string.hostname_message)
.setPositiveButton(R.string.ok_button) { dialog, _ ->
Loading
Loading
@@ -408,7 +408,7 @@ class LoginActivity : BaseActivity() {
.setNegativeButton(R.string.cancel_button) { dialog, _ -> dialog.dismiss() }
.show()
 
d.findViewById<TextView>(android.R.id.message).movementMethod = LinkMovementMethod.getInstance()
dialog.findViewById<TextView>(android.R.id.message).movementMethod = LinkMovementMethod.getInstance()
} else if (t is ConnectException) {
Snackbar.make(root, t.message!!, Snackbar.LENGTH_LONG)
.show()
Loading
Loading
Loading
Loading
@@ -20,8 +20,7 @@ object OkHttpClientFactory {
* @return a configured [okhttp3.OkHttpClient.Builder]
*/
fun create(account: Account, includeSignInAuthenticator: Boolean = true): OkHttpClient.Builder {
// Do we even need a custom trust manager?
// Yep. Otherwise SSL won't work properly with some configurations :) -Michi
// A custom trust manager, otherwise SSL won't work properly with some configurations
val customTrustManager = CustomTrustManager()
customTrustManager.setTrustedCertificate(account.trustedCertificate)
customTrustManager.setTrustedHostname(account.trustedHostname)
Loading
Loading
Loading
Loading
@@ -134,7 +134,7 @@ class BuildsFragment : ButterKnifeFragment() {
nextPageUrl = null
loading = true
App.get().gitLab.getBuilds(project!!.id, scope)
.setup(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
.setup(bindUntilEvent(FragmentEvent.STOP))
.subscribe(object : CustomResponseSingleObserver<List<Build>>() {
 
override fun error(e: Throwable) {
Loading
Loading
Loading
Loading
@@ -77,7 +77,7 @@ class CustomTrustManager : X509TrustManager {
 
var keyManagers: Array<KeyManager>? = null
if (privateKeyAlias != null) {
keyManagers = arrayOf<KeyManager>(CustomKeyManager(privateKeyAlias))
keyManagers = arrayOf(CustomKeyManager(privateKeyAlias))
}
 
try {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment