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 supertab freezing the app #6965

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Wallunen
Copy link

@Wallunen Wallunen commented Aug 4, 2024

First time contributor checklist:

Contributor checklist:

  • My contribution is not related to translations.
  • My commits are in nice logical chunks with good commit messages
  • My changes are rebased on the latest main branch
  • A npm run ready run passes successfully (more about tests here)
  • My changes are ready to be shipped to users

Description

Removes pointless conditions and the infinite, app-freezing while-loop.

@jamiebuilds-signal
Copy link
Member

When are you experiencing this infinite loop error?

@Wallunen
Copy link
Author

Wallunen commented Aug 7, 2024

When are you experiencing this infinite loop error?

Whenever the main UI is not on screen, like when the app is starting up, or before logging in. (Also, it's not an "error"; the app just freezes forever until I force-quit it.) The loop runs forever because the targets array is empty when there are no elements with the data-supertab attribute on screen.

@jamiebuilds-signal jamiebuilds-signal self-assigned this Aug 8, 2024
Copy link
Author

@Wallunen Wallunen left a comment

Choose a reason for hiding this comment

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

jamiebuilds-signal self-requested a review last month

Fine, I'll do it myself. 😤

(focusedElement != null && target === focusedElement) ||
target.contains(focusedElement)
) {
if (target.contains(focusedElement)) {
Copy link
Author

Choose a reason for hiding this comment

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

target.contains(focusedElement) makes the preceding condition pointless because .contains() allows a null parameter and considers elements to also contain themselves.

@@ -42,7 +42,7 @@ export function addGlobalKeyboardShortcuts(): void {
return;
}

// Super tab :)
// Super tab :(
Copy link
Author

Choose a reason for hiding this comment

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

Signal Spirits haunt this codebase. Let the frown scare them away.

Removes the infinite, app-freezing while-loop and handles the now-reachable errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants