File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { quitApp } from '../utils/comms';
15
15
import Constants from '../utils/constants' ;
16
16
import { getFilterCount } from '../utils/helpers' ;
17
17
import {
18
+ openBitbucketPulls ,
18
19
openGitHubIssues ,
19
20
openGitHubNotifications ,
20
21
openGitHubPulls ,
@@ -38,8 +39,10 @@ export const Sidebar: FC = () => {
38
39
} = useContext ( AppContext ) ;
39
40
40
41
// We naively assume that the first account is the primary account for the purposes of our sidebar quick links
42
+ const primaryAccount = auth . accounts [ 0 ] ;
43
+
41
44
const primaryAccountHostname =
42
- auth . accounts [ 0 ] ?. hostname ?? Constants . DEFAULT_AUTH_OPTIONS . hostname ;
45
+ primaryAccount ?. hostname ?? Constants . DEFAULT_AUTH_OPTIONS . hostname ;
43
46
44
47
const toggleFilters = ( ) => {
45
48
if ( location . pathname . startsWith ( '/filters' ) ) {
@@ -91,16 +94,24 @@ export const Sidebar: FC = () => {
91
94
onClick = { ( ) => openGitHubNotifications ( primaryAccountHostname ) }
92
95
/>
93
96
94
- < SidebarButton
95
- title = "My Issues"
96
- icon = { IssueOpenedIcon }
97
- onClick = { ( ) => openGitHubIssues ( primaryAccountHostname ) }
98
- />
97
+ { primaryAccount ?. platform !== 'Bitbucket Cloud' && (
98
+ < SidebarButton
99
+ title = "My Issues"
100
+ icon = { IssueOpenedIcon }
101
+ onClick = { ( ) => openGitHubIssues ( primaryAccountHostname ) }
102
+ />
103
+ ) }
99
104
100
105
< SidebarButton
101
106
title = "My Pull Requests"
102
107
icon = { GitPullRequestIcon }
103
- onClick = { ( ) => openGitHubPulls ( primaryAccountHostname ) }
108
+ onClick = { ( ) => {
109
+ if ( primaryAccount ?. platform === 'Bitbucket Cloud' ) {
110
+ openBitbucketPulls ( primaryAccount ) ;
111
+ } else {
112
+ openGitHubPulls ( primaryAccountHostname ) ;
113
+ }
114
+ } }
104
115
/>
105
116
</ div >
106
117
You can’t perform that action at this time.
0 commit comments