-
Notifications
You must be signed in to change notification settings - Fork 18
[Fix] #867 - 콕찌르기 온보딩 노출 시 기존 유저를 체크하도록 변경 #869
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
kwonseokki
wants to merge
4
commits into
develop
Choose a base branch
from
fix/#867-poke-onboarding-check
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
4 commits
Select commit
Hold shift + click to select a range
1d4fb27
[Feat] #867 - 기존 유저 방문여부 확인을 위한 getIsNewUser 메서드 추가
kwonseokki 3bae31e
[Fix] #867 - 기존 유저 확인 시 isVisitedPokeMainView 결과에 따라 getIsNewUser 메서드…
kwonseokki 1674748
[Fix] #867 - 기존 유저를 체크하도록 콕찌르기 온보딩 노출 조건 변경
kwonseokki de08010
[Fix] #867 - 리뷰 반영
kwonseokki 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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,11 +17,13 @@ public protocol PokeMainUseCase { | |||||||||||||||||||||||||||||||||||||||||||||||||
| var pokedResponse: PassthroughSubject<PokeUserModel, Never> { get } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| var madeNewFriend: PassthroughSubject<PokeUserModel, Never> { get } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| var errorMessage: PassthroughSubject<String?, Never> { get } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| var isNewUser: PassthroughSubject<Bool, Never> { get } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| func getWhoPokedToMe() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| func getFriend() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| func getFriendRandomUser(randomType: PokeRandomUserType, size: Int) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| func poke(userId: Int, message: PokeMessageModel, isAnonymous: Bool, willBeNewFriend: Bool) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| func poke(userId: Int, message: PokeMessageModel, isAnonymous: Bool, willBeNewFriend: Bool) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| func checkPokeOnboardingNeeded() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| public class DefaultPokeMainUseCase { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -34,6 +36,7 @@ public class DefaultPokeMainUseCase { | |||||||||||||||||||||||||||||||||||||||||||||||||
| public let pokedResponse = PassthroughSubject<PokeUserModel, Never>() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| public let madeNewFriend = PassthroughSubject<PokeUserModel, Never>() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| public let errorMessage = PassthroughSubject<String?, Never>() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| public let isNewUser = PassthroughSubject<Bool, Never>() | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| public init(repository: PokeMainRepositoryInterface) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.repository = repository | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -89,4 +92,24 @@ extension DefaultPokeMainUseCase: PokeMainUseCase { | |||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }.store(in: self.cancelBag) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| public func checkPokeOnboardingNeeded() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| #warning("TODO: 온보딩 노출조건 변경으로 기존 유저들을 위해서 임시로 추가 추후 getIsNewUser 체크 로직 제거 필요") | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Just(UserDefaultKeyList.User.isVisitedPokeMainView ?? false) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .withUnretained(self) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .flatMap { [weak self] owner, isVisited in | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if isVisited { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return Just(false) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .eraseToAnyPublisher() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return owner.repository.getIsNewUser() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .replaceError(with: false) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .eraseToAnyPublisher() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+98
to
+109
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
withUnretained를 쓰면 프로젝트 컨벤션에도 맞고 코드도 훨씬 간결해질 것 같습니다! |
||||||||||||||||||||||||||||||||||||||||||||||||||
| .withUnretained(self) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .sink { [weak self] owner, isNewUser in | ||||||||||||||||||||||||||||||||||||||||||||||||||
| owner.isNewUser.send(isNewUser) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }.store(in: self.cancelBag) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
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
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.
기존 Error 타입도 any로 맞추면 좋을 것 같습니다! 추후 Swif6로 마이그레이션 할 때 같이 붙여보아요 . .