Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(custom-study): not attached to an activity #17834

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

david-allison
Copy link
Member

Purpose / Description

  • positiveButton { } closed the dialog
  • so setFragmentResult() threw as there was no fragment manager

Fixes

Approach

  • setting the click handler manually, so dismiss isn't called
  • move dismiss into the call, for clarity that the dialog is dismissed

How Has This Been Tested?

S21, manually. I found that custom studying some of my larger decks caused this to occur

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

* positiveButton { } closed the dialog
* so setFragmentResult() threw as there was no fragment manager

Fixed by:
* setting the click handler manually, so `dismiss` isn't called
* move `dismiss` into the call, for clarity that the dialog
 is dismissed

Fixes 17757
@david-allison david-allison added the Review High Priority Request for high priority review label Jan 17, 2025
Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From testing this fixes the issue and LGTM, thanks!
The original bug can be easily reproduced by adding just a bit of sleeping in the undoableOp.

@lukstbit lukstbit added the Needs Second Approval Has one approval, one more approval to merge label Jan 17, 2025
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My wife will be pleased! I think this will leave just the "review session open while day roll over / card was modified" problem out of all the little issues she's mentioned to me

@mikehardy mikehardy added this pull request to the merge queue Jan 18, 2025
Merged via the queue into ankidroid:main with commit 37b86be Jan 18, 2025
12 checks passed
@github-actions github-actions bot removed the Review High Priority Request for high priority review label Jan 18, 2025
@github-actions github-actions bot added this to the 2.21 release milestone Jan 18, 2025
@github-actions github-actions bot removed the Needs Second Approval Has one approval, one more approval to merge label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CustomStudyDialog tries to dismissAllFragments but requireActivity throws
3 participants