-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/refactor #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Feat/refactor #18
Changes from all commits
0528152
a45c519
cf95238
2d52f23
e685417
a300b3c
f16c832
83fb98b
f41b1e1
28f563b
a04a8d7
9d035f6
e045c49
ddedb8e
8c54035
9e4c5cc
2c54a97
7973fcb
b2ca4c3
0adafee
16a078b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,5 +45,4 @@ class NonggleAppState( | |
| started = SharingStarted.WhileSubscribed(5_000), | ||
| initialValue = false | ||
| ) | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <background android:drawable="@drawable/ic_launcher_background" /> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
| <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
| <background android:drawable="@drawable/ic_launcher_background"/> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground"/> | ||
| </adaptive-icon> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <background android:drawable="@drawable/ic_launcher_background" /> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
| <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
| <background android:drawable="@drawable/ic_launcher_background"/> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground"/> | ||
| </adaptive-icon> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,8 +42,13 @@ class LoginRepositoryImpl @Inject constructor( | |
| } | ||
|
|
||
| override suspend fun logOut(): AppResult<Unit> { | ||
| /// TODO: 로그아웃 구현 | ||
| return AppResult.Success(Unit) | ||
| val response = loginService.logout() | ||
| tokenManager.deleteToken() | ||
|
|
||
| return when(response) { | ||
| is AppResult.Success -> AppResult.Success(Unit) | ||
| is AppResult.Error -> response | ||
| } | ||
| } | ||
|
Comment on lines
44
to
52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: 로그아웃 관련 다른 구현이나 주석을 확인하여 의도된 동작 파악
rg -n -C3 "logOut|logout|deleteToken" --type=ktRepository: Nonggle/Android Length of output: 85 🏁 Script executed: #!/bin/bash
# Kotlin 파일에서 logout, logOut, deleteToken 패턴 검색
rg -n "logOut|logout|deleteToken" --type-list | head -5Repository: Nonggle/Android Length of output: 448 🏁 Script executed: #!/bin/bash
# .kt 확장자 파일에서 logout 관련 코드 검색
fd -e kt | head -20Repository: Nonggle/Android Length of output: 1480 🏁 Script executed: #!/bin/bash
# LoginRepository 관련 파일 찾기
fd -e kt "LoginRepository"Repository: Nonggle/Android Length of output: 212 🏁 Script executed: #!/bin/bash
# core/data 디렉토리의 구조와 파일 확인
find core/data -name "*.kt" -type f | grep -i loginRepository: Nonggle/Android Length of output: 276 🏁 Script executed: #!/bin/bash
# LoginRepositoryImpl.kt 파일 내용 확인
cat core/data/src/main/java/com/nonggle/data/repositoryimpl/LoginRepositoryImpl.ktRepository: Nonggle/Android Length of output: 1868 🏁 Script executed: #!/bin/bash
# LoginRepository 인터페이스 확인
cat core/domain/src/main/java/com/nonggle/domain/repository/LoginRepository.ktRepository: Nonggle/Android Length of output: 401 🏁 Script executed: #!/bin/bash
# 로그아웃 관련 테스트 케이스 검색
find . -name "*Test.kt" -o -name "*Spec.kt" | xargs grep -l "logOut\|logout" 2>/dev/nullRepository: Nonggle/Android Length of output: 133 🏁 Script executed: #!/bin/bash
# 로그아웃 호출 코드 찾기
rg "logOut\(\)" -A3 -B3Repository: Nonggle/Android Length of output: 5368 🏁 Script executed: #!/bin/bash
# TokenManager의 deleteToken 구현 확인
fd -e kt -path "*TokenManager*"Repository: Nonggle/Android Length of output: 227 🏁 Script executed: #!/bin/bash
# MainActivityViewModel 전체 코드 확인
cat app/src/main/java/com/nonggle/nonggleresume/MainActivityViewModel.ktRepository: Nonggle/Android Length of output: 2247 🏁 Script executed: #!/bin/bash
# TokenManager 파일 찾기
find . -name "*TokenManager*" -type fRepository: Nonggle/Android Length of output: 180 🏁 Script executed: #!/bin/bash
# AppResult 타입 확인
rg "class AppResult|sealed class AppResult" -A5Repository: Nonggle/Android Length of output: 41 🏁 Script executed: #!/bin/bash
# TokenManager 인터페이스 확인
cat core/auth/src/main/java/com/nonggle/auth/TokenManager.ktRepository: Nonggle/Android Length of output: 460 🏁 Script executed: #!/bin/bash
# TinkTokenManager 구현 확인
cat core/auth/src/main/java/com/nonggle/auth/TinkTokenManager.ktRepository: Nonggle/Android Length of output: 2456 🏁 Script executed: #!/bin/bash
# AppResult 정의 찾기
find . -name "*.kt" -type f | xargs grep -l "sealed class AppResult\|class AppResult" | head -5Repository: Nonggle/Android Length of output: 41 서버 로그아웃 실패 시에도 토큰 삭제 - 설계 의도는 명확하나, 에러 처리 개선 필요 현재 구현은
다만 개선이 필요한 부분:
개선 방안:
🤖 Prompt for AI Agents |
||
|
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onResume()마다Loading상태로 전환되어 UX 저하 가능성이 있습니다.앱이 백그라운드에서 복귀할 때마다
_uiState가Loading으로 설정되면 스플래시 화면이 잠깐 다시 표시될 수 있습니다. 초기 로딩 시에만Loading상태를 사용하거나, 이미Success상태인 경우Loading으로 전환하지 않는 로직이 필요합니다.또한,
loginRepository.isLoggedIn().first()가 DataStore 등 I/O를 수반한다면 Main dispatcher에서 실행될 수 있으므로, repository 내부에서 적절한 dispatcher 전환이 이루어지는지 확인이 필요합니다.💡 제안된 수정
private fun refreshLoginState() { viewModelScope.launch { - _uiState.value = MainActivityUiState.Loading + // 초기 로딩 시에만 Loading 표시 + if (_uiState.value == MainActivityUiState.Loading) { + // 이미 Loading 상태면 유지 + } _isLoggedIn.value = loginRepository.isLoggedIn().first() _uiState.value = MainActivityUiState.Success } }또는 초기화와 resume 로직을 분리:
🤖 Prompt for AI Agents