Skip to content

Commit

Permalink
Merge pull request #954 from 0x1-company/invite-friend-button-click
Browse files Browse the repository at this point in the history
  • Loading branch information
tomokisun authored Nov 13, 2023
2 parents 2e631b8 + 13eb0c5 commit 6e01a03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ public extension AnalyticsClient {
case shareFeedback = "share_feedback"
case getHelp = "get_help"
case safetyCenter = "safety_center"
case requiredInviteFriend = "required_invite_friend"
}
}
13 changes: 10 additions & 3 deletions Packages/GodPackage/Sources/InviteFriendFeature/InviteFriend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,17 @@ public struct InviteFriendLogic: Reducer {
)
return .none

case .inviteFriendButtonTapped where state.remainingInvitationCount == 0:
return .send(.delegate(.nextScreen))

case .inviteFriendButtonTapped:
let remainingInvitationCount = state.remainingInvitationCount
analytics.buttonClick(
name: .requiredInviteFriend,
parameters: [
"remaining_invitation_count": remainingInvitationCount
]
)
if remainingInvitationCount == 0 {
return .send(.delegate(.nextScreen))
}
state.destination = .activity()
return .none

Expand Down

0 comments on commit 6e01a03

Please sign in to comment.