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

Correctly handle unmount and remount of toolkit reports #3452

Merged
merged 2 commits into from
May 29, 2024

Conversation

OlegWock
Copy link
Contributor

@OlegWock OlegWock commented May 8, 2024

GitHub Issue (if applicable): #3451 #3446

Explanation of Bugfix/Feature/Modification:
Fixed a couple of issues I missed in previous PRs (#3438 #3315)

Screenshots
If you're adding or changing a feature. Please include screenshots or a video of the feature.

Comment on lines 78 to 80
$(`${YNAB_NAVLINK_SELECTOR}, ${YNAB_NAVACCOUNT_SELECTOR}`).on('click', (e) =>
this._removeToolkitReports(e)
);
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to do

$(`${YNAB_NAVLINK_SELECTOR}, ${YNAB_NAVACCOUNT_SELECTOR}`).on('click', this._removeToolkitReports);

or we might add an event listener every time _updateNavigation runs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will attach multiple listeners too. I checked and it seem to be a 'problem' only if user repeatedly clicks on 'Toolkit reports' while they are already open. But anyway I updated, now there will be only one listener at a time

@joshmadewell joshmadewell merged commit 6fd32c3 into toolkit-for-ynab:main May 29, 2024
6 checks passed
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.

None yet

2 participants