@@ -49,7 +49,7 @@ the message is : ${text}.
49
49
c. Strictly avoid AI-related terms like "optimize", "leverage", "streamline"
50
50
d. Should be sentence case.
51
51
e. Make sure you added the core issue (what is the issue) and how this issue was exactly created in title.
52
- eg. Message: Dena please fix open DM chats on notification click, it’ s working randomly for me.
52
+ eg. Message: Dena please fix open DM chats on notification click, it' s working randomly for me.
53
53
Title: Fix open DM on notifications click
54
54
Message2: @Mo this message failed to translate. It was a long message from a zh user
55
55
Title2: Fix translation failure on long zh messages
@@ -128,14 +128,17 @@ type CreateIssueProps = {
128
128
}
129
129
130
130
const createIssueFunc = async ( props : CreateIssueProps ) : Promise < string | undefined > => {
131
- const team = await getLinearTeams ( { userId : props . currentUserId } )
132
- const teamIdValue = team ?. id
133
- const organization = await getLinearOrg ( { userId : props . currentUserId } )
134
- const statuses = await getLinearIssueStatuses ( { userId : props . currentUserId } )
135
- const unstarded = statuses . workflowStates . filter ( ( status : any ) => status . type === "unstarted" )
136
-
137
131
try {
138
- let result = await createIssue ( {
132
+ const [ team , organization , statuses ] = await Promise . all ( [
133
+ getLinearTeams ( { userId : props . currentUserId } ) ,
134
+ getLinearOrg ( { userId : props . currentUserId } ) ,
135
+ getLinearIssueStatuses ( { userId : props . currentUserId } ) ,
136
+ ] )
137
+
138
+ const teamIdValue = team ?. id
139
+ const unstarded = statuses . workflowStates . filter ( ( status : any ) => status . type === "unstarted" )
140
+
141
+ const result = await createIssue ( {
139
142
userId : props . currentUserId ,
140
143
title : props . title ,
141
144
description : props . description ,
@@ -147,9 +150,9 @@ const createIssueFunc = async (props: CreateIssueProps): Promise<string | undefi
147
150
statusId : unstarded [ 0 ] . id ,
148
151
} )
149
152
150
- let link = generateIssueLink ( result ?. identifier ?? "" , organization ?. urlKey ?? "" )
151
- return link
153
+ return generateIssueLink ( result ?. identifier ?? "" , organization ?. urlKey ?? "" )
152
154
} catch ( error ) {
153
155
Log . shared . error ( "Failed to create Linear issue" , { error } )
156
+ return undefined
154
157
}
155
158
}
0 commit comments