mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Remove _.compact
This commit is contained in:
parent
2d56663fc4
commit
0da953b40e
@ -195,15 +195,12 @@ export default DiscourseRoute.extend(FilterModeMixin, {
|
|||||||
// Pre-fill the tags input field
|
// Pre-fill the tags input field
|
||||||
if (controller.get("model.id")) {
|
if (controller.get("model.id")) {
|
||||||
const composerModel = this.controllerFor("composer").get("model");
|
const composerModel = this.controllerFor("composer").get("model");
|
||||||
|
|
||||||
composerModel.set(
|
composerModel.set(
|
||||||
"tags",
|
"tags",
|
||||||
_.compact(
|
[
|
||||||
_.flatten([
|
|
||||||
controller.get("model.id"),
|
controller.get("model.id"),
|
||||||
controller.get("additionalTags")
|
...controller.get("additionalTags")
|
||||||
])
|
].filter(Boolean)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -253,7 +253,7 @@ export function emojiSearch(term, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isSkinTonableEmoji(term) {
|
export function isSkinTonableEmoji(term) {
|
||||||
const match = _.compact(term.split(":"))[0];
|
const match = term.split(":").filter(Boolean)[0];
|
||||||
if (match) {
|
if (match) {
|
||||||
return tonableEmojis.indexOf(match) !== -1;
|
return tonableEmojis.indexOf(match) !== -1;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ export function lookupCachedUploadUrl(shortUrl) {
|
|||||||
const MISSING = "missing";
|
const MISSING = "missing";
|
||||||
|
|
||||||
export function lookupUncachedUploadUrls(urls, ajax) {
|
export function lookupUncachedUploadUrls(urls, ajax) {
|
||||||
urls = _.compact(urls);
|
urls = urls.filter(Boolean);
|
||||||
if (urls.length === 0) {
|
if (urls.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user