-
Notifications
You must be signed in to change notification settings - Fork 104
Conversation
6893157
to
ae1344d
Compare
is AutofillAction.Authenticate -> builder.buildAuthenticationFillResponse(this).asOptional() | ||
is AutofillAction.Cancel -> Optional(null) | ||
is AutofillAction.Error -> { | ||
callback.onFailure(getString(R.string.autofill_error_toast, it.error.localizedMessage)) |
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.
👏 moving this out of the subscribe
is DataStore.State.Errored -> AutofillAction.Error(state.error) | ||
} | ||
} | ||
.subscribe(dispatcher::dispatch) |
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.
What happens when we dispatch an Optional
? (ex: AutofillAction.Cancel -> Optional(null)
)
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.
None of these are Optional
, the type for the Observable
is AutofillAction
.
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.
Ohh I see. It dispatches the action, then it goes down and does the Optional
stuff. Got it 🥇
.map { | ||
@Suppress("IMPLICIT_CAST_TO_ANY") | ||
when (it) { | ||
is AutofillAction.Complete -> builder.buildFilteredFillResponse(this, listOf(it.login)).asOptional() |
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.
The Context here (this
) is now the AutofillAction instead of the DatastoreState. Are these two interchangeable to get the package name correctly in the builder?
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.
this
is the instance of the AutofillService
in this case.
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.
Ahh ok. Misread that in AS :)
Fixes #122
To Do