Skip to content

Commit e30783b

Browse files
committed
fix: only use discussion for feed error
1 parent 8a9cac6 commit e30783b

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

apps/renderer/src/lib/issues.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ interface IssueOptions {
66
body: string
77
label: string
88
error?: Error
9+
target: "issue" | "discussion"
10+
category: string
911
}
1012

11-
export const getNewIssueUrl = ({ body, label, title, error }: Partial<IssueOptions> = {}) => {
12-
const baseUrl = `${repository.url}/discussions/new`
13+
export const getNewIssueUrl = ({
14+
body,
15+
label,
16+
title,
17+
error,
18+
target = "issue",
19+
category,
20+
}: Partial<IssueOptions> = {}) => {
21+
const baseUrl =
22+
target === "discussion" ? `${repository.url}/discussions/new` : `${repository.url}/issues/new`
1323

1424
const searchParams = new URLSearchParams()
15-
searchParams.set("category", "feed-expired")
25+
if (category) searchParams.set("category", category)
1626

1727
let nextBody = [body || "", "", ...getCurrentEnvironment()].join("\n")
1828
if (label) searchParams.set("label", label)

apps/renderer/src/modules/discover/feed-form.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ export const FeedForm: Component<{
140140
"```",
141141
].join("\n"),
142142
title: `Error in fetching feed: ${id ?? url}`,
143+
target: "discussion",
144+
category: "feed-expired",
143145
}),
144146
"_blank",
145147
)

0 commit comments

Comments
 (0)