package Ġcom . t ib agn i . log viewer . bug report Ċ Ċ import Ġcom . t ib agn i . log viewer . Async Presenter Ċ import Ġcom . t ib agn i . log viewer . Progress Reporter Ċ Ċ interface ĠBug Report Presenter Ġ{ ĊĠ Ġfun Ġload Bug Report ( bug report Text : ĠString ) ĊĠ Ġfun Ġclose Bug Report () ĊĠ Ġfun Ġfinish ing () Ċ } Ċ Ċ class ĠBug Report Presenter Impl ( ĊĠ Ġprivate Ġval Ġview : ĠBug Report Presenter View , ĊĠ Ġprivate Ġval Ġbug Report Repository : ĠBug Report Repository Ċ ) Ġ: ĠAsync Presenter ( view ), ĊĠ ĠBug Report Presenter Ġ{ ĊĠ Ġoverride Ġfun Ġload Bug Report ( bug report Text : ĠString ) Ġ{ ĊĠĠĠ Ġdo Async Ġ{ ĊĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠ Ġbug Report Repository . load Bug Report ( bug report Text , ĠProgress Reporter Ġ{ Ġprogress , Ġnote Ġ-> ĊĠĠĠĠĠĠĠĠĠ Ġupdate Async Progress ( progress , Ġnote ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠ Ġdo On Ui Thread Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġbug Report Repository . bug Report ?. let Ġ{ Ġview . show Bug Report ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠOpen Bug Report Exception ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdo On Ui Thread { view . show ErrorMessage ( e . message )} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġclose Bug Report () Ġ{ ĊĠĠĠ Ġbug Report Repository . close Bug Report () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġfinish ing () Ġ{ ĊĠĠĠ Ġ// ĠWe Ġonly Ġcare Ġabout Ġreleasing Ġthe Ġthread Ġpool Ġhere ĊĠĠĠ Ġrelease () ĊĠ Ġ} Ċ }