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 add profile conditions #416

Merged
merged 3 commits into from
Dec 22, 2023
Merged

Conversation

Casheeew
Copy link
Collaborator

This change resolves #414 .
I believe this bug is caused by #364 . However, I am not sure if this solution captures every instance caused by this change.
@toasted-nutbread thoughts?

@Casheeew Casheeew requested a review from a team as a code owner December 21, 2023 16:39
@Casheeew Casheeew marked this pull request as draft December 21, 2023 16:40
Copy link

github-actions bot commented Dec 21, 2023

✔️ No visual differences introduced by this PR.

View Playwright Report (note: open the "playwright-report" artifact)

@toasted-nutbread
Copy link

Presumably this is due to elements not existing in certain contexts. If that's the case, mark the type as nullable and omit the cast.

/** @type {?HTMLButtonElement} */
this._menuButton = this._node.querySelector('.profile-condition-menu-button');

@toasted-nutbread
Copy link

That being said, this is probably another case of legacy code never being fully removed. If you search for profile-condition-remove in the codebase, it only comes up in one place: the code that is being modified here. This indicates that the element actually doesn't exist, and all codepaths involving this field should just be deleted.

@toasted-nutbread
Copy link

For _conditionContainer, you can leave that as the NotNull version and just remove any subsequent null checks. Same for _menuButton.

The reason these dead codepaths and unnecessary checks exist is because there was a massive UI overhaul of the settings page a long time ago, and the same classes would drive both versions of the settings page for the time they co-existed.

@Casheeew Casheeew marked this pull request as ready for review December 21, 2023 23:48
@Casheeew
Copy link
Collaborator Author

Thanks. I included the changes.

@djahandarie djahandarie added this pull request to the merge queue Dec 22, 2023
Merged via the queue into themoeway:master with commit 8d2aaf2 Dec 22, 2023
5 checks passed
@Casheeew Casheeew deleted the development branch December 22, 2023 14:12
@djahandarie djahandarie added the kind/bug The issue or PR is regarding a bug label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug The issue or PR is regarding a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add profile conditions not working
3 participants