@@ -179,6 +179,7 @@ export class DraftService implements Disposable {
179179 createdAt : new Date ( draft . createdAt ) ,
180180 updatedAt : new Date ( draft . updatedAt ?? draft . createdAt ) ,
181181 author : author ,
182+ isMine : true ,
182183 organizationId : draft . organizationId || undefined ,
183184 role : draft . role ,
184185 isPublished : draft . isPublished ,
@@ -351,10 +352,12 @@ export class DraftService implements Disposable {
351352 email : undefined ,
352353 } ;
353354
355+ let isMine = false ;
354356 const { account } = await this . container . subscription . getSubscription ( ) ;
355357 if ( draft . createdBy === account ?. id ) {
356358 author . name = `${ account . name } (you)` ;
357359 author . email = account . email ;
360+ isMine = true ;
358361 }
359362
360363 return {
@@ -364,6 +367,7 @@ export class DraftService implements Disposable {
364367 createdAt : new Date ( draft . createdAt ) ,
365368 updatedAt : new Date ( draft . updatedAt ?? draft . createdAt ) ,
366369 author : author ,
370+ isMine : isMine ,
367371 organizationId : draft . organizationId || undefined ,
368372 role : draft . role ,
369373 isPublished : draft . isPublished ,
@@ -388,15 +392,16 @@ export class DraftService implements Disposable {
388392 const draft = ( ( await rsp . json ( ) ) as Result ) . data ;
389393 const { account } = await this . container . subscription . getSubscription ( ) ;
390394
391- return draft . map (
392- ( d ) : Draft => ( {
395+ return draft . map ( ( d ) : Draft => {
396+ const isMine = d . createdBy === account ?. id ;
397+ return {
393398 draftType : 'cloud' ,
394399 type : d . type ,
395400 id : d . id ,
396- author :
397- d . createdBy === account ?. id
398- ? { id : d . createdBy , name : ` ${ account . name } (you)` , email : account . email }
399- : { id : d . createdBy , name : 'Unknown' , email : undefined } ,
401+ author : isMine
402+ ? { id : d . createdBy , name : ` ${ account . name } (you)` , email : account . email }
403+ : { id : d . createdBy , name : 'Unknown' , email : undefined } ,
404+ isMine : isMine ,
400405 organizationId : d . organizationId || undefined ,
401406 role : d . role ,
402407 isPublished : d . isPublished ,
0 commit comments