mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
|
oldSearch
|
||||||
.then(function(r) {
|
.then(function(r) {
|
||||||
const hasResults = !!(
|
const hasResults = !!(
|
||||||
r.users.length ||
|
(r.users && r.users.length) ||
|
||||||
r.groups.length ||
|
(r.groups && r.groups.length) ||
|
||||||
r.emails.length
|
(r.emails && r.emails.length)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (eagerComplete && !hasResults) {
|
if (eagerComplete && !hasResults) {
|
||||||
|
@ -27,6 +27,10 @@ QUnit.module("lib:user-search", {
|
|||||||
]});
|
]});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(request.url.match(/no-results/)){
|
||||||
|
return response({users: []});
|
||||||
|
}
|
||||||
|
|
||||||
return response({
|
return response({
|
||||||
users: [
|
users: [
|
||||||
{
|
{
|
||||||
@ -167,4 +171,10 @@ QUnit.test("it skips a search depending on punctuations", async assert => {
|
|||||||
|
|
||||||
results = await userSearch({ term: "sam@sam.com" });
|
results = await userSearch({ term: "sam@sam.com" });
|
||||||
assert.equal(results.length, 0);
|
assert.equal(results.length, 0);
|
||||||
|
|
||||||
|
results = await userSearch({
|
||||||
|
term: "no-results@example.com",
|
||||||
|
allowEmails: true
|
||||||
|
});
|
||||||
|
assert.equal(results.length, 1);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user