Skip to content

Commit

Permalink
NTV-277: Collaborator & Baker can comment on project updates and proj…
Browse files Browse the repository at this point in the history
…ect (#1446)
  • Loading branch information
Arkariang committed Nov 3, 2021
1 parent de2ea04 commit bd569e9
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -18,7 +18,6 @@ import com.kickstarter.models.extensions.cardStatus
import com.kickstarter.models.extensions.updateCanceledPledgeComment
import com.kickstarter.models.extensions.updateCommentAfterSuccessfulPost
import com.kickstarter.models.extensions.updateCommentFailedToPost
import com.kickstarter.services.ApiClientType
import com.kickstarter.services.ApolloClientType
import com.kickstarter.services.apiresponses.commentresponse.CommentEnvelope
import com.kickstarter.ui.IntentKey
Expand Down Expand Up @@ -77,7 +76,6 @@ interface CommentsViewModel {
class ViewModel(@NonNull val environment: Environment) : ActivityViewModel<CommentsActivity>(environment), Inputs, Outputs {

private val currentUser: CurrentUserType = environment.currentUser()
private val client: ApiClientType = environment.apiClient()
private val apolloClient: ApolloClientType = environment.apolloClient()
val inputs: Inputs = this
val outputs: Outputs = this
Expand Down Expand Up @@ -155,7 +153,7 @@ interface CommentsViewModel {
}.flatMap {
it?.either<Observable<Project?>>(
{ value: Project? -> Observable.just(value) },
{ u: Update? -> client.fetchProject(u?.projectId().toString()).compose(Transformers.neverError()) }
{ u: Update? -> apolloClient.getProject(u?.projectId().toString()).compose(Transformers.neverError()) }
)
}.map {
requireNotNull(it)
Expand Down Expand Up @@ -461,7 +459,6 @@ interface CommentsViewModel {
when {
projectAndUser.second == null -> CommentComposerStatus.GONE
projectAndUser.first.canComment() ?: false -> CommentComposerStatus.ENABLED
projectAndUser.first.isBacking -> CommentComposerStatus.ENABLED
else -> CommentComposerStatus.DISABLED
}

Expand Down

0 comments on commit bd569e9

Please sign in to comment.