Open
Conversation
Sangwook123
reviewed
May 14, 2024
| override var checkLogin: Boolean | ||
| get() = sharedPreferences.getBoolean(CHECK_LOGIN, false) | ||
| set(value) = sharedPreferences.edit { putBoolean(CHECK_LOGIN, value) } | ||
| get() = runBlocking { |
chanubc
reviewed
May 14, 2024
Contributor
chanubc
left a comment
There was a problem hiding this comment.
고생하셨습니다
datastore에 관한 di모듈은 data 모듈 안에서만 있어도 될것 같아요!
Comment on lines
12
to
25
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| object SharedPreferenceModule { | ||
| private const val PREFERENCE_NAME = "chanu_dataStore" | ||
| private val Context.datastore by preferencesDataStore( | ||
| name = PREFERENCE_NAME | ||
| ) | ||
|
|
||
| @Provides | ||
| @Singleton | ||
| fun providesLocalPreferences( | ||
| @ApplicationContext context: Context | ||
| ): SharedPreferences = | ||
| EncryptedSharedPreferences.create( | ||
| context, | ||
| context.packageName, | ||
| MasterKey.Builder(context).setKeyScheme(MasterKey.KeyScheme.AES256_GCM).build(), | ||
| EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, | ||
| EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM | ||
| ) | ||
| ) = context.datastore | ||
| } |
Contributor
There was a problem hiding this comment.
이거 모듈 data모듈로 이동해 주세요!
지금은 app모듈, data모듈 둘다 라이브러리에 의존해야하는데 data모듈에서 필요할때만 사용해도 될것 같아요
Comment on lines
+7
to
+9
| suspend fun saveUserInfo(userDto: UserDto?) | ||
| suspend fun getUserInfo(): UserDto | ||
| suspend fun clear() |
Contributor
There was a problem hiding this comment.
suspend를 사용해도 되고 타입을 Flow타입으로 감싸주어도 될것 같습니다!
전 후자로 진행했어요
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴