clear the stored Account Name at disabling google sync
This commit is contained in:
parent
84d710dd6d
commit
038d00ed0a
|
@ -90,7 +90,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
|||
config.googleSync = false
|
||||
}
|
||||
|
||||
if (config.syncAccountName.isNotEmpty()) {
|
||||
if (config.syncAccountName.isNotEmpty() && config.googleSync) {
|
||||
FetchGoogleEventsTask(this, googleSyncListener).execute()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,6 +134,8 @@ class SettingsActivity : SimpleActivity() {
|
|||
|
||||
if (settings_google_sync.isChecked) {
|
||||
tryEnablingSync()
|
||||
} else {
|
||||
disableGoogleSync()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -346,8 +348,9 @@ class SettingsActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun disableGoogleSync() {
|
||||
settings_google_sync.toggle()
|
||||
settings_google_sync.isChecked = false
|
||||
config.googleSync = false
|
||||
config.syncAccountName = ""
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
|
||||
|
|
Loading…
Reference in New Issue