Close channel autocomplete if multiple tildes are typed (#2138)

This commit is contained in:
Joram Wilander 2018-09-20 12:36:37 -04:00 committed by Harrison Healey
parent 8a93b6b91e
commit 1d37f9bbec

View file

@ -46,7 +46,13 @@ export const getMatchTermForChannelMention = (() => {
lastValue = value;
lastIsSearch = isSearch;
if (match) {
lastMatchTerm = isSearch ? match[1] : match[2];
if (isSearch) {
lastMatchTerm = match[1];
} else if (match.index > 0 && value[match.index - 1] === '~') {
lastMatchTerm = null;
} else {
lastMatchTerm = match[2];
}
} else {
lastMatchTerm = null;
}