-
Notifications
You must be signed in to change notification settings - Fork 1
SCRUM-273 feat: Connect settings logout flow #49
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
Changes from all commits
be065de
ac752e3
06d49c8
8c39933
86b2fc6
be19c9c
cc6dff3
70b3083
c7fd12a
8cdd34a
9e84483
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 |
|---|---|---|
|
|
@@ -225,3 +225,7 @@ fabric.properties | |
| # 개인 프롬프트 파일 | ||
| .daegeun | ||
| .daegeun/** | ||
|
|
||
| # oh-my-openagent files | ||
| .sisyphus | ||
| .sisyphus/** | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,9 @@ import com.lyrics.feelin.core.designsystem.icon.NoteSearchingInactiveIcon | |
| import com.lyrics.feelin.presentation.util.openExternalBrowser | ||
| import com.lyrics.feelin.presentation.view.community.CommunityMainScreen | ||
| import com.lyrics.feelin.presentation.view.login.LoginScreen | ||
| import com.lyrics.feelin.presentation.view.mypage.MyPageLogoutStatus | ||
| import com.lyrics.feelin.presentation.view.mypage.MyPageScreen | ||
| import com.lyrics.feelin.presentation.view.mypage.MyPageViewModel | ||
| import com.lyrics.feelin.presentation.view.mypage.setting.SettingScreen | ||
| import com.lyrics.feelin.presentation.view.mypage.userinfo.UserInfoScreen | ||
| import com.lyrics.feelin.presentation.view.note.search.NoteSearchScreen | ||
|
|
@@ -285,27 +287,49 @@ private fun NavGraphBuilder.mainNavGraph(navController: NavHostController) { | |
|
|
||
| private fun NavGraphBuilder.myPageNavGraph(navController: NavHostController) { | ||
| navigation(startDestination = FeelinDestination.MyPage.route, route = FeelinDestination.MyPageGraph.route) { | ||
| composable(FeelinDestination.MyPage.route) { | ||
| composable(FeelinDestination.MyPage.route) { backStackEntry -> | ||
|
Member
Author
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. 마이페이지, 설정 화면, 프로필 변경 화면 등이 동일한 사용자 정보를 공유하는 것을 고려해 마이페이지 뷰모델을 마이페이지 그래프의 공용 뷰모델로 사용하는 방향으로 정했습니다. |
||
| val parentEntry = remember(backStackEntry) { | ||
| navController.getBackStackEntry(FeelinDestination.MyPageGraph.route) | ||
| } | ||
| val viewModel: MyPageViewModel = hiltViewModel(parentEntry) | ||
|
|
||
| MainScaffold(navController = navController, selectedIndex = 2) { | ||
| MyPageScreen( | ||
| onSettingClick = { navController.navigate(FeelinDestination.Setting.route) } | ||
| onSettingClick = { navController.navigate(FeelinDestination.Setting.route) }, | ||
| viewModel = viewModel, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composable(FeelinDestination.Setting.route) { | ||
| composable(FeelinDestination.Setting.route) { backStackEntry -> | ||
| val parentEntry = remember(backStackEntry) { | ||
| navController.getBackStackEntry(FeelinDestination.MyPageGraph.route) | ||
| } | ||
| val viewModel: MyPageViewModel = hiltViewModel(parentEntry) | ||
| val logoutStatus by viewModel.logoutStatus.collectAsState() | ||
| val context = LocalContext.current | ||
|
|
||
| LaunchedEffect(logoutStatus) { | ||
| if (logoutStatus == MyPageLogoutStatus.SUCCESS) { | ||
| viewModel.clearLogoutStatus() | ||
| navController.navigate(FeelinDestination.OnboardingGraph.route) { | ||
| popUpTo(FeelinDestination.MainGraph.route) { inclusive = true } | ||
|
Comment on lines
+312
to
+316
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. 로그아웃 완료 내비게이션을 Useful? React with 👍 / 👎.
Member
Author
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. SCRUM-276 의 전역 로딩 인디케이터에서 뒤로가기 버튼/제스처를 막도록 같이 구현할 예정. |
||
| } | ||
| } | ||
| } | ||
|
gdaegeun539 marked this conversation as resolved.
|
||
|
|
||
| MainScaffold(navController = navController, selectedIndex = 2) { | ||
| SettingScreen( | ||
| onBackClick = { navController.popBackStack() }, | ||
| onUserInfoClick = { navController.navigate(FeelinDestination.UserInfo.route) }, | ||
| onLogoutClick = viewModel::logout, | ||
| onInternalWebViewClick = { url -> | ||
| navController.navigate(FeelinDestination.InternalWebView.createRoute(url)) | ||
| }, | ||
| onExternalBrowserClick = { url -> | ||
| context.openExternalBrowser(url) | ||
| }, | ||
| isLogoutLoading = logoutStatus == MyPageLogoutStatus.LOADING, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
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.
iOS 앱에서는 로그아웃 엔드포인트를 호출하지 않고 로컬 토큰만 삭제하더라고요. 안드로이드가 해당 방식을 동일하게 따라가지는 않더라도 서버 실패를 무조건 로그아웃 실패로 취급할 필요는 없어 보여서 로그아웃 메소드의 세부 구현을 변경했습니다.