Skip to content

Commit 5e1baf2

Browse files
committed
Restore copilot checks
These were removed a while ago in a failed attempt to fix commit generation. This commit reverts those changes so they are aligned with upstream once again
1 parent 4b3647f commit 5e1baf2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

app/src/lib/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type ViewerCopilotResponse = {
5353
readonly copilotEndpoints: {
5454
readonly api: string
5555
}
56+
readonly isCopilotDesktopEnabled: boolean
5657
}
5758
}
5859
}
@@ -2796,6 +2797,8 @@ export class API {
27962797
copilotEndpoints {
27972798
api
27982799
}
2800+
2801+
isCopilotDesktopEnabled
27992802
}
28002803
}
28012804
`
@@ -2813,7 +2816,7 @@ export class API {
28132816
const { viewer } = json.data
28142817
return {
28152818
copilotEndpoint: viewer.copilotEndpoints.api,
2816-
isCopilotDesktopEnabled: !!viewer.copilotEndpoints.api,
2819+
isCopilotDesktopEnabled: viewer.isCopilotDesktopEnabled,
28172820
}
28182821
} catch (e) {
28192822
log.warn(`fetchUserCopilotInfo: failed with endpoint ${this.endpoint}`, e)

app/src/lib/feature-flag.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ export const enableResizingToolbarButtons = () => true
9090

9191
export const enableCommitMessageGeneration = (account: Account) => {
9292
return (
93+
(account.features ?? []).includes(
94+
'desktop_copilot_generate_commit_message'
95+
) &&
9396
// IMPORTANT: Do not remove this feature flag without replacing its usages
9497
// with a check for the `isCopilotDesktopEnabled` property on the account.
9598
account.isCopilotDesktopEnabled

0 commit comments

Comments
 (0)