Repository navigation
Dynamically updates pull request menu item label - #3432
Conversation
| return | ||
| } | ||
|
|
||
| const pullRequests = await this.pullRequestStore.getPullRequests( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| }) | ||
| } | ||
|
|
||
| private async getPullRequestLabel(repository?: Repository) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** Update the menu with the names of the user's preferred apps. */ | ||
| private updatePreferredAppMenuItemLabels() { | ||
| private async updatePreferredAppMenuItemLabels(repository?: Repository) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🥇 |
| let prLabel: string | undefined | ||
|
|
||
| if (repository) { | ||
| prLabel = await this.getPullRequestLabel(repository) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| /** | ||
| * Update menu labels for editor, shell, and pull requests. | ||
| */ | ||
| private async updateMenuItemLabels(repository?: Repository) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const branchState = repositoryState.branchesState | ||
|
|
||
| if (!branchState.currentPullRequest) { | ||
| return |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
joshaber
left a comment
There was a problem hiding this comment.
I was so focused on the code I missed what was missing here 😂
When the label is "Show Pull Request", clicking it should open directly to the PR instead of going to github.com/repo/name/pull/new/branch_name.
Got it, currently opening the url 🥇 |
| accelerator: 'CmdOrCtrl+R', | ||
| click: emit('create-pull-request'), | ||
| click: | ||
| pullRequestLabel === defaultPullRequestLabel |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🔢 |
|
This looks good ✨ Just needs a merge in from |
|
💬 |
Fixes #2524