-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 최근 로그인 계정 정보 안내 기능 구현 #243
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
Open
easyhooon
wants to merge
6
commits into
develop
Choose a base branch
from
BOOK-475-feature/#233
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d4e3170
[BOOK-475] feat: LoginTooltipBox 구성
easyhooon 55d9c59
[BOOK-475] feat: 최근 로그인 방식 관리를 위한 DataStore 환경 구축
easyhooon 4fee138
[BOOK-475] feat: 로그인 버튼에 로그인 툴팁 배치
easyhooon 50ebe6e
[BOOK-475] chore: code style check success
easyhooon 810ad58
[BOOK-475] chore: compose stability check success
easyhooon afd2256
[BOOK-475] chore: code style check success
easyhooon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...c/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LoginMethodDataSource.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.ninecraft.booket.core.datastore.api.datasource | ||
|
|
||
| import com.ninecraft.booket.core.model.LoginMethod | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface LoginMethodDataSource { | ||
| val recentLoginMethod: Flow<LoginMethod> | ||
| suspend fun setRecentLoginMethod(loginMethod: LoginMethod) | ||
| suspend fun clearRecentLoginMethod() | ||
| } |
48 changes: 48 additions & 0 deletions
48
...otlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLoginMethodDataSource.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package com.ninecraft.booket.core.datastore.impl.datasource | ||
|
|
||
| import androidx.datastore.core.DataStore | ||
| import androidx.datastore.preferences.core.Preferences | ||
| import androidx.datastore.preferences.core.edit | ||
| import androidx.datastore.preferences.core.stringPreferencesKey | ||
| import com.ninecraft.booket.core.datastore.api.datasource.LoginMethodDataSource | ||
| import com.ninecraft.booket.core.datastore.impl.di.LoginMethodDataStore | ||
| import com.ninecraft.booket.core.datastore.impl.util.handleIOException | ||
| import com.ninecraft.booket.core.di.DataScope | ||
| import com.ninecraft.booket.core.model.LoginMethod | ||
| import dev.zacsweers.metro.Inject | ||
| import dev.zacsweers.metro.SingleIn | ||
| import kotlinx.coroutines.flow.Flow | ||
| import kotlinx.coroutines.flow.map | ||
|
|
||
| @SingleIn(DataScope::class) | ||
| @Inject | ||
| class DefaultLoginMethodDataSource( | ||
| @LoginMethodDataStore private val dataStore: DataStore<Preferences>, | ||
| ) : LoginMethodDataSource { | ||
| override val recentLoginMethod: Flow<LoginMethod> = dataStore.data | ||
| .handleIOException() | ||
| .map { prefs -> | ||
| val method = prefs[RECENT_LOGIN_METHOD] | ||
| when (method) { | ||
| "KAKAO" -> LoginMethod.KAKAO | ||
| "GOOGLE" -> LoginMethod.GOOGLE | ||
| else -> LoginMethod.NONE | ||
| } | ||
| } | ||
|
|
||
| override suspend fun setRecentLoginMethod(loginMethod: LoginMethod) { | ||
| dataStore.edit { prefs -> | ||
| prefs[RECENT_LOGIN_METHOD] = loginMethod.name | ||
| } | ||
| } | ||
|
|
||
| override suspend fun clearRecentLoginMethod() { | ||
| dataStore.edit { prefs -> | ||
| prefs.remove(RECENT_LOGIN_METHOD) | ||
| } | ||
| } | ||
|
|
||
| companion object { | ||
| private val RECENT_LOGIN_METHOD = stringPreferencesKey("RECENT_LOGIN_METHOD") | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
core/model/src/main/kotlin/com/ninecraft/booket/core/model/LoginMethod.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.ninecraft.booket.core.model | ||
|
|
||
| enum class LoginMethod { | ||
| NONE, | ||
| KAKAO, | ||
| GOOGLE, | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: YAPP-Github/Reed-Android
Length of output: 1459
logout() 메서드에서 clearRecentLoginMethod() 호출 누락
logout()메서드에서clearRecentLoginMethod()를 호출하지 않고 있습니다.withdraw()메서드에서는 호출되고 있으나,logout()에서는 누락되어 있습니다. 사용자가 로그아웃 후 다시 로그인 화면에 접근할 때 이전 로그인 방식이 표시되는 불일치한 동작이 발생합니다.logout()메서드에도clearRecentLoginMethod()를 추가하여withdraw()와 일관성 있게 수정해주세요.🤖 Prompt for AI Agents