package Ġcom . an es ab ml . product h unt . ui . main Ċ Ċ import Ġandroidx . h ilt . Ass isted Ċ import Ġandroidx . h ilt . lifecycle . ViewModel Inject Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . Saved State Handle Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . an es ab ml . product h unt . data . repository . Authentication Repository Ċ import Ġcom . an es ab ml . product h unt . model . User Ċ import Ġcom . an es ab ml . lib . extension . as LiveData Ċ import Ġcom . an es ab ml . lib . network . Result Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠMain ViewModel Ġ@ ViewModel Inject Ġconstructor ( ĊĠĠĠ Ġ@ Ass isted Ġprivate Ġval Ġsaved State Handle : ĠSaved State Handle , ĊĠĠĠ Ġprivate Ġval Ġauthentication Repository : ĠAuthentication Repository Ċ ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġ_ user : ĠMutable LiveData < Result < User >> Ġ= ĠMutable LiveData () ĊĠĠĠ Ġval Ġuser Ġ= Ġ_ user . as LiveData () ĊĊĠĠĠ Ġfun ĠgetCurrent Viewer () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġauthentication Repository . getCurrent User () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ user . post Value ( result ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ