mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Dialog database action #2234
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
KeePassDX(4.2.1)
|
||||
* Fix Magikeyboard autosearch #2233
|
||||
* Fix database merge #2223
|
||||
* Fix dialog database action #2234
|
||||
|
||||
KeePassDX(4.2.0)
|
||||
* Passkeys management #1421 #2097 (@cali-95)
|
||||
|
||||
@@ -65,7 +65,6 @@ abstract class DatabaseActivity : StylishActivity(), DatabaseRetrieval {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
is DatabaseViewModel.ActionState.OnDatabaseInfoChanged -> {
|
||||
if (manageDatabaseInfo()) {
|
||||
showDatabaseChangedDialog(
|
||||
@@ -75,29 +74,21 @@ abstract class DatabaseActivity : StylishActivity(), DatabaseRetrieval {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
is DatabaseViewModel.ActionState.OnDatabaseActionRequested -> {
|
||||
startDatabasePermissionService(
|
||||
uiState.bundle,
|
||||
uiState.actionTask
|
||||
)
|
||||
}
|
||||
|
||||
is DatabaseViewModel.ActionState.OnDatabaseActionStarted -> {
|
||||
if (showDatabaseDialog())
|
||||
startDialog(uiState.progressMessage)
|
||||
showDialog(uiState.progressMessage)
|
||||
}
|
||||
|
||||
is DatabaseViewModel.ActionState.OnDatabaseActionUpdated -> {
|
||||
if (showDatabaseDialog())
|
||||
updateDialog(uiState.progressMessage)
|
||||
showDialog(uiState.progressMessage)
|
||||
}
|
||||
|
||||
is DatabaseViewModel.ActionState.OnDatabaseActionStopped -> {
|
||||
// Remove the progress task
|
||||
stopDialog()
|
||||
// nothing here, wait for the action to finish
|
||||
}
|
||||
|
||||
is DatabaseViewModel.ActionState.OnDatabaseActionFinished -> {
|
||||
onDatabaseActionFinished(
|
||||
uiState.database,
|
||||
@@ -203,8 +194,9 @@ abstract class DatabaseActivity : StylishActivity(), DatabaseRetrieval {
|
||||
}
|
||||
}
|
||||
|
||||
private fun startDialog(progressMessage: ProgressMessage) {
|
||||
private fun showDialog(progressMessage: ProgressMessage) {
|
||||
lifecycleScope.launch {
|
||||
if (showDatabaseDialog()) {
|
||||
if (progressTaskDialogFragment == null) {
|
||||
progressTaskDialogFragment = supportFragmentManager
|
||||
.findFragmentByTag(PROGRESS_TASK_DIALOG_TAG) as ProgressTaskDialogFragment?
|
||||
@@ -216,11 +208,6 @@ abstract class DatabaseActivity : StylishActivity(), DatabaseRetrieval {
|
||||
PROGRESS_TASK_DIALOG_TAG
|
||||
)
|
||||
}
|
||||
updateDialog(progressMessage)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateDialog(progressMessage: ProgressMessage) {
|
||||
progressTaskDialogFragment?.apply {
|
||||
updateTitle(progressMessage.titleId)
|
||||
updateMessage(progressMessage.messageId)
|
||||
@@ -228,6 +215,8 @@ abstract class DatabaseActivity : StylishActivity(), DatabaseRetrieval {
|
||||
setCancellable(progressMessage.cancelable)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun stopDialog() {
|
||||
progressTaskDialogFragment?.dismissAllowingStateLoss()
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Fix Magikeyboard autosearch #2233
|
||||
* Fix database merge #2223
|
||||
* Fix dialog database action #2234
|
||||
@@ -1,2 +1,3 @@
|
||||
* Correction de la recherche auto pour le Magikeyboard #2233
|
||||
* Correction de la fusion de bases de données #2223
|
||||
* Correction de l'action de la base de données #2234
|
||||
Reference in New Issue
Block a user