sindresorhus/refined-github

Original "Create pull request button" isn't removed #3914

mischnic posted onGitHub

Refined Github adds a separate button for a draft PR, but the original button isn't removed:

Bildschirmfoto 2021-01-27 um 19 24 51


Last change broke the feature on GHE as well, I'll see if I can fix both sometime this week.

posted by busches about 4 years ago

I can't recreate this 🤷 Tried Dark Mode too and the button is gone. Do you have any other extensions running? I'd guess another is interfering with it or you're in some beta group I am not.

posted by busches about 4 years ago

Strange, I don't get it here:

https://github.com/sindresorhus/refined-github/compare/unknow-feature-name?expand=1

Bildschirmfoto 2021-01-28 um 11 40 47

but for example here:

https://github.com/parcel-bundler/parcel/compare/abstract-fs-part-2?expand=1

Bildschirmfoto 2021-01-28 um 11 41 17

The only difference I can think of is that I have push access to the Parcel repo.

posted by mischnic about 4 years ago

Same problem spotted on a private repository, I have 3 buttons.

posted by MrChocolatine about 4 years ago

Strangely I can't replicate it. Do you see any errors in the console?

<img width="693" alt="Screen Shot" src="https://user-images.githubusercontent.com/1402241/106211972-3b6aba80-618f-11eb-945d-94f076e6602c.png">

posted by fregante about 4 years ago

Yes:

refined-github.js:2134 ❌ Refined GitHub → separate-draft-pr-button → TypeError: Cannot read property 'name' of undefined
    at init (refined-github.js:6722)
    at runFeature (refined-github.js:2152)
    at setupPageLoad (refined-github.js:2160)
    at refined-github.js:2193 
Search issue: https://github.com/sindresorhus/refined-github/issues?q=is%3Aissue+Cannot%20read%20property%20'name'%20of%20undefined

Open an issue: https://github.com/sindresorhus/refined-github/issues/new?labels=bug&template=bug_report.md&title=%60separate-draft-pr-button%60%3A%20Cannot%20read%20property%20'name'%20of%20undefined
posted by mischnic about 4 years ago

In the loop iteration where the error is thrown, dropdownItem here

https://github.com/sindresorhus/refined-github/blob/3aadf2f9141107d7ca92e8753f2a66cbc10ebd9d/source/features/separate-draft-pr-button.tsx#L24

is this element:

<img width="768" alt="Bildschirmfoto 2021-01-29 um 00 42 36" src="https://user-images.githubusercontent.com/4586894/106212423-e482d680-61ca-11eb-9771-3b4f1a14b690.png">

where <details> at the very top is the assignee menu:

<img width="1302" alt="Bildschirmfoto 2021-01-29 um 00 40 00" src="https://user-images.githubusercontent.com/4586894/106212271-8655f380-61ca-11eb-8e67-3e1b1550b1d6.png">

If I'm not a member of the repo, there is no assignee/reviewer dropdown at all. So that would explain the differing behaviour on my side.

posted by mischnic about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests