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 duplication of features on back/forward button click #5761

Merged
merged 2 commits into from
Jul 1, 2022
Merged

Conversation

fregante
Copy link
Member

@fregante fregante commented Jul 1, 2022

Test

  1. Open https://github.com/refined-github/refined-github/issues
  2. Click on the "Closed" filter
  3. Go back and forth
  4. Click on the "Code" tab
  5. Go back and forth
  6. Open a folder
  7. Go back and forth

@@ -324,7 +324,7 @@ void add('rgh-deduplicator' as FeatureID, {
// `await` kicks it to the next tick, after the other features have checked for 'has-rgh', so they can run once.
await Promise.resolve();
select('#js-repo-pjax-container, #js-pjax-container')?.append(<has-rgh/>);
select('#repo-content-pjax-container')?.append(<has-rgh-inner/>); // #4567
select('#repo-content-pjax-container, turbo-frame')?.append(<has-rgh-inner/>); // #4567
Copy link
Member Author

Choose a reason for hiding this comment

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

I found that turbo-frame contains #repo-content-pjax-container on the first load and then it's gone. Select will return the first element matching the selector, which is always turbo-frame since it's the parent

@fregante fregante added bug ajax Temporary label to collect Ajax issues labels Jul 1, 2022
@fregante fregante merged commit 09466a8 into main Jul 1, 2022
@fregante fregante deleted the turbo-frame branch July 1, 2022 12:28
@fregante fregante changed the title Avoid duplicate features on history navigation Fix duplication of features on back/forward button click Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ajax Temporary label to collect Ajax issues bug
Development

Successfully merging this pull request may close these issues.

#repo-content-pjax-container is gone
1 participant