Skip to content

Commit 3c09205

Browse files
authored
Allows me to believe I assigned an issue on a repo where I lack that permission (#7611)
Fixes #7534
1 parent b5a13e3 commit 3c09205

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/github/issueOverview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class IssueOverviewPanel<TItem extends IssueModel = IssueModel> extends W
200200
}
201201

202202
protected getInitializeContext(currentUser: IAccount, issue: IssueModel, timelineEvents: TimelineEvent[], repositoryAccess: RepoAccessAndMergeMethods, viewerCanEdit: boolean, assignableUsers: IAccount[]): Issue {
203-
const hasWritePermission = repositoryAccess!.hasWritePermission;
203+
const hasWritePermission = repositoryAccess.hasWritePermission;
204204
const canEdit = hasWritePermission || viewerCanEdit;
205205
const labels = issue.item.labels.map(label => ({
206206
...label,

webviews/components/sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function Section({
3232
return (
3333
<div id={id} className="section">
3434
<div
35-
className="section-header"
36-
onClick={onHeaderClick}
35+
className={`section-header ${hasWritePermission ? 'clickable' : ''}`}
36+
onClick={hasWritePermission ? onHeaderClick : undefined}
3737
>
3838
<div className="section-title">{title}</div>
3939
{hasWritePermission ? (

webviews/editorWebview/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,9 @@ small-button {
624624
display: flex;
625625
justify-content: space-between;
626626
align-items: center;
627+
}
628+
629+
.section-header.clickable {
627630
cursor: pointer;
628631
}
629632

0 commit comments

Comments
 (0)