|
|
|
@ -655,7 +655,17 @@ class MainActivity : AppCompatActivity() {
|
|
|
|
|
fun checkGhostConnection(): Boolean {
|
|
|
|
|
if (ghostConnection) return true
|
|
|
|
|
if (SharedPrefsCookiePersistor(applicationContext).loadAll().size == 0) {
|
|
|
|
|
ghostSettings.launch(Intent(this, LoginActivity::class.java))
|
|
|
|
|
this.runOnUiThread({
|
|
|
|
|
with(AlertDialog.Builder(this)){
|
|
|
|
|
setTitle("No ghost CMS login defined. Edit credentials?")
|
|
|
|
|
setPositiveButton("Yes", { dialog, id ->
|
|
|
|
|
ghostSettings.launch(Intent(this@MainActivity, LoginActivity::class.java))
|
|
|
|
|
})
|
|
|
|
|
setNeutralButton("No", { dialog, id ->
|
|
|
|
|
})
|
|
|
|
|
show()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
// we have a cookie
|
|
|
|
|