Skip to content

Commit

Permalink
Update LoginViewModel : Fix for Ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
yymin1022 committed Jan 26, 2024
1 parent 88a0b83 commit 93f75be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@ import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class LoginViewModel @Inject constructor(): ViewModel() {
class LoginViewModel
@Inject

Check failure on line 15 in app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Unexpected indentation (0) (should be 4) Raw Output: app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt:15:1: error: Unexpected indentation (0) (should be 4) (standard:indent)
constructor() :

Check failure on line 16 in app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Unexpected indentation (0) (should be 4) Raw Output: app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt:16:1: error: Unexpected indentation (0) (should be 4) (standard:indent)
ViewModel() {
val isLoggedIn = MutableLiveData(false)

Check failure on line 18 in app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Unexpected indentation (4) (should be 8) Raw Output: app/src/main/java/com/gdsc_cau/vridge/login/LoginViewModel.kt:18:1: error: Unexpected indentation (4) (should be 8) (standard:indent)

fun tryGoogleLogin(signInLauncher: ActivityResultLauncher<Intent>) {
FirebaseAuthUtil.tryGoogleLogin(signInLauncher)
}

fun onSignInResult(result: FirebaseAuthUIAuthenticationResult) {
if (result.resultCode == ComponentActivity.RESULT_OK
&& FirebaseAuthUtil.getCurrentUser() != null) {
if (result.resultCode == ComponentActivity.RESULT_OK &&
FirebaseAuthUtil.getCurrentUser() != null
) {
isLoggedIn.postValue(true)
} else {
// TODO: Show Snack Bar?
}
}
}
}

0 comments on commit 93f75be

Please sign in to comment.