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 icon flicker #157

Merged
merged 5 commits into from
Sep 27, 2024
Merged

Fix icon flicker #157

merged 5 commits into from
Sep 27, 2024

Conversation

hankxdev
Copy link
Owner

To fix #146
The reason that some icon change while toggling the state of other extensions is the use of reverse on icon list.

To fix it, use a simple sort function to make sure the order does not change.

// Get a large icon closest to the desired size
for (const icon of icons.reverse()) {
for (const icon of sortedIcons) {
Copy link
Collaborator

@fregante fregante Sep 27, 2024

Choose a reason for hiding this comment

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

Good catch! We can actually use .toSorted() now

Copy link
Collaborator

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Actually I don’t think this fixes it. .sort() also alters the array just like .reverse()

.toSorted() will fix it, just need to bump the minimum chrome version to 110

Edit: already is!

"minimum_chrome_version": "110",

@fregante fregante changed the title fix image state change #146 Fix icon flicker Sep 27, 2024
@fregante fregante added the bug label Sep 27, 2024
@hankxdev hankxdev merged commit 5489d8d into main Sep 27, 2024
7 checks passed
@fregante fregante deleted the 146-extension-icon-state branch September 27, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unrelated icons change when extensions are toggled
2 participants