Skip to content

Commit 2bb3376

Browse files
Copilotduhow
andauthored
fix: undo button toggle and immediate background reset after operation
Agent-Logs-Url: https://github.com/duhow/nfc-coins/sessions/f8b06635-b5b2-47df-9f03-6d4c5dd16f72 Co-authored-by: duhow <1145001+duhow@users.noreply.github.com>
1 parent 503fde9 commit 2bb3376

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/net/duhowpi/nfccoins/MainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class MainActivity : AppCompatActivity() {
221221
override fun onOptionsItemSelected(item: MenuItem): Boolean {
222222
return when (item.itemId) {
223223
R.id.action_undo -> {
224-
startUndoTransaction()
224+
if (pendingAction == PendingAction.UNDO_TRANSACTION) resetToWaiting() else startUndoTransaction()
225225
true
226226
}
227227
R.id.action_history -> {
@@ -1365,6 +1365,7 @@ class MainActivity : AppCompatActivity() {
13651365
if (scheduleAutoReset) {
13661366
this.scheduleAutoReset()
13671367
}
1368+
invalidateOptionsMenu()
13681369
}
13691370

13701371
private fun setScreenStatusSuccess(
@@ -1382,6 +1383,7 @@ class MainActivity : AppCompatActivity() {
13821383
if (scheduleAutoReset) {
13831384
this.scheduleAutoReset()
13841385
}
1386+
invalidateOptionsMenu()
13851387
}
13861388

13871389
/**

0 commit comments

Comments
 (0)