Commit f5afa19e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RoomPresenter.java

parent b00237ca
......@@ -231,10 +231,12 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
}
private void getUserByUsername(String username) {
Disposable disposable = userRepository.getByUsername(username)
final Disposable disposable = userRepository.getByUsername(username)
.distinctUntilChanged()
.filter(Optional::isPresent)
.map(Optional::get)
.subscribeOn(AndroidSchedulers.from(BackgroundLooper.get()))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(view::showUserStatus, Logger::report);
addSubscription(disposable);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment