mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -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
|
||||
if (controller.get("model.id")) {
|
||||
const composerModel = this.controllerFor("composer").get("model");
|
||||
|
||||
composerModel.set(
|
||||
"tags",
|
||||
_.compact(
|
||||
_.flatten([
|
||||
controller.get("model.id"),
|
||||
controller.get("additionalTags")
|
||||
])
|
||||
)
|
||||
[
|
||||
controller.get("model.id"),
|
||||
...controller.get("additionalTags")
|
||||
].filter(Boolean)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -253,7 +253,7 @@ export function emojiSearch(term, options) {
|
||||
}
|
||||
|
||||
export function isSkinTonableEmoji(term) {
|
||||
const match = _.compact(term.split(":"))[0];
|
||||
const match = term.split(":").filter(Boolean)[0];
|
||||
if (match) {
|
||||
return tonableEmojis.indexOf(match) !== -1;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export function lookupCachedUploadUrl(shortUrl) {
|
||||
const MISSING = "missing";
|
||||
|
||||
export function lookupUncachedUploadUrls(urls, ajax) {
|
||||
urls = _.compact(urls);
|
||||
urls = urls.filter(Boolean);
|
||||
if (urls.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user