8000 fix: Rare loop of storage events between tabs causing flickering UI by tommoor · Pull Request #7996 · outline/outline · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Rare loop of storage events between tabs causing flickering UI #7996

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

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

tommoor
Copy link
Member
@tommoor tommoor commented Nov 20, 2024

It is possible to rapidly toggle some UI elements faster than these changes can be communicated between tabs via the "storage" event. When this happens it can cause an infinite loop that can only be stopped by closing a tab.

@@ -324,6 +307,10 @@ class UiStore {
theme: this.theme,
};
}

private persist = () => {
Storage.set(UI_STORE, this.asJson);
Copy link
Member Author

Choose a reason for hiding this comment

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

Overall this solution is pretty dated, but we'll keep it for now for backwards compat

@tommoor tommoor marked this pull request as ready for review November 21, 2024 00:01
@@ -134,10 +135,6 @@ class UiStore {
this.tocVisible = newData.tocVisible;
}
});

autorun(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing the autorun means we won't write to storage unless the user in this tab interacts.

@tommoor tommoor merged commit eedfd54 into main Nov 21, 2024
11 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.

1 participant
0