Skip to content

Commit

Permalink
Fix logout dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
MrApplejuice committed Sep 2, 2024
1 parent 3e02837 commit 8da39e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ class MainActivity : AppCompatActivity() {

fun logout() {
credStore.clearLoginData()
timerControls.clear()
internalClient = null
// Storage gets cleaned in the resume function of the login fragment
// because otherwise the cleanup functions of the LoggedIn fragment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ class GlobalDebugObject {
return result
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import android.app.ProgressDialog
import android.content.DialogInterface
import androidx.fragment.app.Fragment
import androidx.navigation.Navigation.findNavController
import eu.pkgsoftware.babybuddywidgets.BaseFragment
import eu.pkgsoftware.babybuddywidgets.CredStore
import eu.pkgsoftware.babybuddywidgets.R
import eu.pkgsoftware.babybuddywidgets.networking.babybuddy.ConnectingDialogInterface

class CoordinatedDisconnectDialog(val fragment: Fragment, val credStore: CredStore) {
class CoordinatedDisconnectDialog(val fragment: BaseFragment, val credStore: CredStore) {
private val dialog = ProgressDialog(fragment.requireContext())
private var uniqueCounter = 1
private val progressTrackers = mutableMapOf<String, Long>()
Expand All @@ -21,7 +22,7 @@ class CoordinatedDisconnectDialog(val fragment: Fragment, val credStore: CredSto
ProgressDialog.BUTTON_NEGATIVE,
fragment.resources.getString(R.string.disconnect_dialog_logout)
) { dialogInterface: DialogInterface, i: Int ->
credStore.clearLoginData()
fragment.mainActivity.logout()
findNavController(fragment.requireView()).navigate(R.id.logoutOperation)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,4 @@ class Client(val credStore: ServerAccessProviderInterface) {
}
}
}
}
}

0 comments on commit 8da39e2

Please sign in to comment.