1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-09-20 08:29:09 -05:00

Remove force sync dialog (#938)

This commit is contained in:
Rafał Borcz 2020-09-01 14:58:45 +02:00 committed by GitHub
parent 90be9d1add
commit f8b7baef24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 18 deletions

View File

@ -120,15 +120,6 @@ class SettingsFragment : PreferenceFragmentCompat(),
ErrorDialog.newInstance(error).show(childFragmentManager, error.toString()) ErrorDialog.newInstance(error).show(childFragmentManager, error.toString())
} }
override fun showForceSyncDialog() {
AlertDialog.Builder(requireContext())
.setTitle(R.string.pref_services_dialog_force_sync_title)
.setMessage(R.string.pref_services_dialog_force_sync_summary)
.setPositiveButton(android.R.string.ok) { _, _ -> presenter.onForceSyncDialogSubmit() }
.setNegativeButton(android.R.string.cancel) { _, _ -> }
.show()
}
override fun showFixSyncDialog() { override fun showFixSyncDialog() {
AlertDialog.Builder(requireContext()) AlertDialog.Builder(requireContext())
.setTitle(R.string.pref_notify_fix_sync_issues) .setTitle(R.string.pref_notify_fix_sync_issues)

View File

@ -55,14 +55,6 @@ class SettingsPresenter @Inject constructor(
} }
fun onSyncNowClicked() { fun onSyncNowClicked() {
view?.showForceSyncDialog()
}
fun onFixSyncIssuesClicked() {
view?.showFixSyncDialog()
}
fun onForceSyncDialogSubmit() {
view?.run { view?.run {
syncManager.startOneTimeSyncWorker().onEach { workInfo -> syncManager.startOneTimeSyncWorker().onEach { workInfo ->
when (workInfo.state) { when (workInfo.state) {
@ -87,4 +79,8 @@ class SettingsPresenter @Inject constructor(
}.launch("sync") }.launch("sync")
} }
} }
fun onFixSyncIssuesClicked() {
view?.showFixSyncDialog()
}
} }

View File

@ -18,6 +18,5 @@ interface SettingsView : BaseView {
fun setSyncInProgress(inProgress: Boolean) fun setSyncInProgress(inProgress: Boolean)
fun showForceSyncDialog()
fun showFixSyncDialog() fun showFixSyncDialog()
} }