Skip to content

Commit

Permalink
Fix heisenbug in set-default-repositories-type-to-sources (#3913)
Browse files Browse the repository at this point in the history
Co-authored-by: Federico <me@fregante.com>
  • Loading branch information
cheap-glitch and fregante committed Jan 28, 2021
1 parent 0849e37 commit 8a603bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/features/set-default-repositories-type-to-sources.tsx
@@ -1,4 +1,5 @@
import select from 'select-dom';
import onetime from 'onetime';

import features from '.';
import onProfileDropdownLoad from '../github-events/on-profile-dropdown-load';
Expand All @@ -23,12 +24,15 @@ async function init(): Promise<void> {
for (const link of links) {
addSourceTypeToLink(link);
}
}

// "Your repositories" in header dropdown
async function profileDropdown(): Promise<void> {
await onProfileDropdownLoad();
addSourceTypeToLink(select('.header-nav-current-user ~ a[href$="tab=repositories"]')!);
addSourceTypeToLink(select('.header-nav-current-user ~ a[href$="tab=repositories"]')!); // "Your repositories" in header dropdown
}

void features.add(__filebasename, {
init: onetime(profileDropdown)
}, {
init
});

0 comments on commit 8a603bc

Please sign in to comment.