mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
FIX: Correct error when sending PM to email address
This commit is contained in:
parent
918bb76f76
commit
071a82efe3
@ -54,9 +54,9 @@ function performSearch(
|
||||
oldSearch
|
||||
.then(function(r) {
|
||||
const hasResults = !!(
|
||||
r.users.length ||
|
||||
r.groups.length ||
|
||||
r.emails.length
|
||||
(r.users && r.users.length) ||
|
||||
(r.groups && r.groups.length) ||
|
||||
(r.emails && r.emails.length)
|
||||
);
|
||||
|
||||
if (eagerComplete && !hasResults) {
|
||||
|
@ -27,6 +27,10 @@ QUnit.module("lib:user-search", {
|
||||
]});
|
||||
}
|
||||
|
||||
if(request.url.match(/no-results/)){
|
||||
return response({users: []});
|
||||
}
|
||||
|
||||
return response({
|
||||
users: [
|
||||
{
|
||||
@ -167,4 +171,10 @@ QUnit.test("it skips a search depending on punctuations", async assert => {
|
||||
|
||||
results = await userSearch({ term: "sam@sam.com" });
|
||||
assert.equal(results.length, 0);
|
||||
|
||||
results = await userSearch({
|
||||
term: "no-results@example.com",
|
||||
allowEmails: true
|
||||
});
|
||||
assert.equal(results.length, 1);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user