-
Notifications
You must be signed in to change notification settings - Fork 0
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
점검화면 추가 #356
점검화면 추가 #356
Conversation
LaunchedEffect(Unit) { | ||
remoteConfig.noticeConfig.collect { | ||
if (it.visible) { | ||
navController.navigateAsOrigin("${NavigationDestination.ImportantNotice}?title=${URLEncoder.encode(it.title, "UTF-8").replace("+", "%20")}&content=${URLEncoder.encode(it.content, "UTF-8").replace("+", "%20")}") |
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.
+를 공백으로 바꿔주는 URLEncoder.encode()는 왜 필요한거야? 서버에서 그렇게 내려오기도 하나?
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.
URLEncoder.encode가 공백을 +로 바꿔버림
그래서 다시 공백으로 바꾸는 과정
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.
아하 그리고 URLEncoder.encode를 쓴 이유는
내용에 한글이 들어가면 처리가 안되는 경우가 있대
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.
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.
오 뭐지 내가 같은 크래시가 나서
URLEncoder.encode를 안쓰다가 쓴건데 다시 바꿔봐야겠다
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.
일단 저 URLEncoder.encoe()는 문자열 -> application/ x-www-form-urlencode 변환하는 함수고, 내비게이션에서의 argument에 전달할 때 그런 변환이 필요하진 않을듯
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.
argument안쓰고, ImportantNoticePage에서 한 번 더 collect하는 방법으로 수정
app/src/main/java/com/wafflestudio/snutt2/data/important_notice/ImportantNoticeRepository.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/wafflestudio/snutt2/data/important_notice/ImportantNoticeRepositoryImpl.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/wafflestudio/snutt2/di/RepositoryModule.kt
Outdated
Show resolved
Hide resolved
fun RemoteConfigDtoNetwork.NoticesConfig.toExternalModel() = RemoteConfigDto.NoticesConfig( | ||
visible = visible ?: false, | ||
title = title, | ||
content = content, | ||
) |
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.
data class ImportantNotice있던데 RemoteConfigDto.NoticeConfig 말고 ImportantNotice 쓰는거어때?
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.
그 이게 RemoteConfigDto 전체를 externalmodel로 바꿀 때 쓰려고 만든거라서
(요 부분 위에 있는 RemoteConfigDtoNetwork.toExternalModel())
그러면 아예 그냥 RemoteConfigDto 자체가 NoticeConfig를 쓰지 않고 ImportantNotice를 쓰게 바꿔야하긴 해
No description provided.