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 recursive button bug #17

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Fix recursive button bug #17

merged 2 commits into from
Jul 12, 2024

Conversation

TabulateJarl8
Copy link
Owner

An updated version of textual was causing a bug which affected the private account screen. They changed the @on decorator to take an argument to specify on which element it is listening to. For example, here's the before:

@on(Button.Pressed)
async def populate_table(self) -> None:
    ...

This would then listen to any button press in the application, even the button to close the private account error modal, which would then re-trigger an account check, which would in turn display the private account screen, causing an infinite and inescapable loop. Here's the fixed version of the above code, specifying which element to listen to:

@on(Button.Pressed, '#submit-button')
async def populate_table(self) -> None:
    ...

…rivate account screen to never be able to be closed
@TabulateJarl8 TabulateJarl8 added the bug Something isn't working label Jul 12, 2024
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (968888d) to head (d91eeeb).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          336       336           
=========================================
  Hits           336       336           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TabulateJarl8 TabulateJarl8 merged commit 91f563e into master Jul 12, 2024
7 checks passed
@TabulateJarl8 TabulateJarl8 deleted the fix-recursive-button branch July 12, 2024 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant