Fixed channel mention autocomplete to not match completed mentions (#5101)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
576c662f27
Коммит
23e7414d35
@@ -56,6 +56,18 @@ export default class ChannelMentionProvider extends Provider {
|
|||||||
if (captured) {
|
if (captured) {
|
||||||
const prefix = captured[3];
|
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);
|
this.startNewRequest(prefix);
|
||||||
|
|
||||||
autocompleteChannels(
|
autocompleteChannels(
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user