Fixed channel mention autocomplete to not match completed mentions (#5101)

Этот коммит содержится в:
Harrison Healey
2017-01-20 08:19:23 -05:00
коммит произвёл Joram Wilander
родитель 576c662f27
Коммит 23e7414d35

Просмотреть файл

@@ -56,6 +56,18 @@ export default class ChannelMentionProvider extends Provider {
if (captured) {
const prefix = captured[3];
if ((/\s/).test(prefix)) {
// If there's a space, there's a chance that we've already completed this mention
const firstWordOfPrefix = prefix.split(' ')[0];
for (const channel of ChannelStore.getChannels()) {
if (firstWordOfPrefix === channel.name) {
// We've already mentioned this channel so there's nothing else to look for
return;
}
}
}
this.startNewRequest(prefix);
autocompleteChannels(