Skip to content

Commit

Permalink
Fix bug causing incorrect mention suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
cody-signal authored and alan-signal committed Oct 13, 2020
1 parent e778ab2 commit c7389dd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public class ConversationActivity extends PassphraseRequiredActivity
private ConversationViewModel viewModel;
private InviteReminderModel inviteReminderModel;
private ConversationGroupViewModel groupViewModel;
private MentionsPickerViewModel mentionsViewModel;

private LiveRecipient recipient;
private long threadId;
Expand Down Expand Up @@ -1980,7 +1981,7 @@ private void initializeGroupViewModel() {
}

private void initializeMentionsViewModel() {
MentionsPickerViewModel mentionsViewModel = ViewModelProviders.of(this, new MentionsPickerViewModel.Factory()).get(MentionsPickerViewModel.class);
mentionsViewModel = ViewModelProviders.of(this, new MentionsPickerViewModel.Factory()).get(MentionsPickerViewModel.class);

recipient.observe(this, r -> {
if (r.isPushV2Group() && !mentionsSuggestions.resolved()) {
Expand Down Expand Up @@ -2122,6 +2123,10 @@ private void onRecipientChanged(@NonNull Recipient recipient) {
if (groupViewModel != null) {
groupViewModel.onRecipientChange(recipient);
}

if (mentionsViewModel != null) {
mentionsViewModel.onRecipientChange(recipient);
}
}

@Subscribe(threadMode = ThreadMode.MAIN)
Expand Down

0 comments on commit c7389dd

Please sign in to comment.