Skip to content

Fix supertab freezing the app - #6965

Open
Wallunen wants to merge 1 commit into
signalapp:mainfrom
Wallunen:fix-supertab
Open

Fix supertab freezing the app#6965
Wallunen wants to merge 1 commit into
signalapp:mainfrom
Wallunen:fix-supertab

Conversation

@Wallunen

@Wallunen Wallunen commented Aug 4, 2024

Copy link
Copy Markdown

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
Copy Markdown
Member

When are you experiencing this infinite loop error?

@Wallunen

Wallunen commented Aug 7, 2024

Copy link
Copy Markdown
Author

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-requested a review August 8, 2024 16:06
@jamiebuilds-signal jamiebuilds-signal self-assigned this Aug 8, 2024

@Wallunen Wallunen left a comment

Copy link
Copy Markdown
Author

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
Copy Markdown
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.

}

// Super tab :)
// Super tab :(

Copy link
Copy Markdown
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants