Fix save, un-save state refresh error #108
Merged
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.
수정사항
PlayEmojiView
를 빠져나가면 저장했던 상태가 휘발되는 문제를 해결했습니다.getMe
api를 사용해 유저가 저장한 이모지 리스트와 비교해 저장했던 이모지인지 여부를 판별합니다.따라서 페이지를 이동하여도 과거 저장 기록은 (선택한 이모지가 저장했던 이모지인지) 사라지지 않습니다.
saveEmojiState
,unSaveEmojiState
를 LiveData로 사용해 api에서 save/unSave가 성공적으로 수행했을 경우에만 saveCount 증감이 표시되도록 하였고 만약 save/unSave 실패 시 (e.g. No internet connection도 처리 가능합니다)Emoji save failed!
toast가 띄워집니다.