File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -150,12 +150,12 @@ export interface AmpThreadSummary {
150150 archived : boolean ;
151151 creatorUserID : string ;
152152 usesDtw : boolean ;
153- env : {
154- initial : {
155- trees : AmpThreadTree [ ] ;
153+ env ? : {
154+ initial ? : {
155+ trees ? : AmpThreadTree [ ] ;
156156 } ;
157157 } ;
158- relationships : Array < {
158+ relationships ? : Array < {
159159 type : string ;
160160 role : 'parent' | 'child' ;
161161 threadID : string ;
Original file line number Diff line number Diff line change @@ -49,14 +49,13 @@ export async function listAllThreads(): Promise<Thread[]> {
4949}
5050
5151function toThread ( s : AmpThreadSummary ) : Thread {
52- const trees = s . env . initial . trees ;
53- const tree = trees [ 0 ] ;
52+ const tree = s . env ?. initial ?. trees ?. [ 0 ] ;
5453 const repoUrl = tree ?. repository ?. url ;
5554
5655 // Extract handoff relationships
5756 let handoffParentId : string | null = null ;
5857 const handoffChildIds : string [ ] = [ ] ;
59- for ( const rel of s . relationships ) {
58+ for ( const rel of s . relationships ?? [ ] ) {
6059 if ( rel . type === 'handoff' ) {
6160 if ( rel . role === 'child' ) {
6261 handoffParentId = rel . threadID ;
You can’t perform that action at this time.
0 commit comments