From e9e875766f906e5186887408cc34ec2052fdd13d Mon Sep 17 00:00:00 2001
From: lilia <liliakai@gmail.com>
Date: Wed, 17 Jun 2015 12:20:30 -0700
Subject: [PATCH] Group update recipient typeahead excludes exisiting members

Fixes #199

// FREEBIE
---
 js/views/new_group_update_view.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/js/views/new_group_update_view.js b/js/views/new_group_update_view.js
index 498933a36..6c46c036c 100644
--- a/js/views/new_group_update_view.js
+++ b/js/views/new_group_update_view.js
@@ -31,6 +31,13 @@
             this.recipients_view = new Whisper.RecipientsInputView({
                 placeholder: "Add member"
             });
+            this.listenTo(this.recipients_view.typeahead, 'sync', function() {
+                this.model.contactCollection.models.forEach(function(model) {
+                    if (this.recipients_view.typeahead.get(model)) {
+                        this.recipients_view.typeahead.remove(model);
+                    }
+                }.bind(this));
+            });
             this.$('.scrollable').append(this.recipients_view.el);
 
             this.$('.avatar').addClass('default');