-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Post Editing #685
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
Conversation
| if (isPostEditMode) { | ||
| PostEditImages(images = postImages) | ||
| } else { | ||
| WriteUploadImages( | ||
| images = processedImages, | ||
| deleteImage = { index -> deleteImageUri(index) }, | ||
| onEditImage = { index -> editImage(index) }, | ||
| ) | ||
| } |
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.
WriteUploadImages 내부에서 editMode로 분기처리하면 더 복잡해질까요??
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.
별도의 변수로 관리하고 있었고, 추후 다른 디자인 가능성에 따라 분리된 컴포저블로 만들었었습니다.
아래 리뷰처럼 ImageAsset으로 통합하고 하나의 processedImages로 관리한 뒤, 내부에서 분기하도록 변경하겠습니다
| private val _postImages = MutableStateFlow<List<String>>(emptyList()) | ||
| val postImages = _postImages.asStateFlow() |
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.
image관련 변수를 2개 유지하는 것보다 ImageAsset data class쪽을 확장시켜서 하나로 통합해서 관리하는게 더 좋지않을까요?
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.
좋습니다!
| private fun setPostEditImages(images: List<String>) { | ||
| viewModelScope.launch { | ||
| _postImages.emit(images) | ||
| } | ||
| } | ||
|
|
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.
addOriginalImages(uris: List) 와 통합해서 사용하면 좋지않을까요?
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.
addOriginalImages에서는 readExifInfo를 통해서 exif 정보를 가져오도록 하는데, 서버에서 불러온 이미지는 contentResolver를 통해 정보를 불러 올 수 없어서 따로 처리 했습니다.
…nto writeImagesUri
|
@DongJun-H 글 작성화면에서 BackHandler가 제대로 동작하지 않는 문제도 추가로 수정했습니닷 |
작업 내용
글 수정하기 기능
a. 글 작성하기 화면을 재사용 하므로 editMode인 경우에만 정보를 불러오며, postEditId가 null일 때 한 번만 불러오도록 합니다.
b. 불러올 수 없는 경우 메시지를 보여주고 이전 화면으로 돌아갑니다.
게시글 작성
기타
참고