From 2113a2251102096ae6a0edc0ea2b76493ed6d1ed Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 4 Mar 2018 13:52:35 -0800 Subject: [PATCH] remove unnecessary lodash/identity filters --- routes/_actions/deleteStatuses.js | 3 +-- routes/_actions/statuses.js | 3 +-- routes/_components/IconButton.html | 4 +--- routes/_components/status/Status.html | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/routes/_actions/deleteStatuses.js b/routes/_actions/deleteStatuses.js index 27022c62..9cc9d269 100644 --- a/routes/_actions/deleteStatuses.js +++ b/routes/_actions/deleteStatuses.js @@ -2,7 +2,6 @@ import { getIdsThatRebloggedThisStatus, getIdThatThisStatusReblogged, getNotific import { store } from '../_store/store' import { scheduleIdleTask } from '../_utils/scheduleIdleTask' import { database } from '../_database/database' -import identity from 'lodash/identity' function deleteStatusIdsFromStore (instanceName, idsToDelete) { let idsToDeleteSet = new Set(idsToDelete) @@ -27,7 +26,7 @@ async function deleteStatusesAndNotifications (instanceName, statusIdsToDelete, async function doDeleteStatus (instanceName, statusId) { let reblogId = await getIdThatThisStatusReblogged(instanceName, statusId) let rebloggedIds = await getIdsThatRebloggedThisStatus(reblogId || statusId) - let statusIdsToDelete = Array.from(new Set([statusId, reblogId].concat(rebloggedIds).filter(identity))) + let statusIdsToDelete = Array.from(new Set([statusId, reblogId].concat(rebloggedIds).filter(Boolean))) let notificationIdsToDelete = new Set(await getNotificationIdsForStatuses(instanceName, statusIdsToDelete)) await Promise.all([ deleteStatusesAndNotifications(instanceName, statusIdsToDelete, notificationIdsToDelete) diff --git a/routes/_actions/statuses.js b/routes/_actions/statuses.js index 7c47ec0c..de07418d 100644 --- a/routes/_actions/statuses.js +++ b/routes/_actions/statuses.js @@ -1,4 +1,3 @@ -import identity from 'lodash/identity' import { database } from '../_database/database' export async function getIdThatThisStatusReblogged (instanceName, statusId) { @@ -10,7 +9,7 @@ export async function getIdsThatTheseStatusesReblogged (instanceName, statusIds) let reblogIds = await Promise.all(statusIds.map(async statusId => { return getIdThatThisStatusReblogged(instanceName, statusId) })) - return reblogIds.filter(identity) + return reblogIds.filter(Boolean) } export async function getIdsThatRebloggedThisStatus (instanceName, statusId) { diff --git a/routes/_components/IconButton.html b/routes/_components/IconButton.html index 5c854cca..5f6bcabd 100644 --- a/routes/_components/IconButton.html +++ b/routes/_components/IconButton.html @@ -60,8 +60,6 @@ }