Duplicative method cleanup (#6431)

This commit is contained in:
Tom Moor
2024-01-25 20:02:17 -08:00
committed by GitHub
parent cab9a1ec96
commit e62c734c41
13 changed files with 87 additions and 122 deletions

View File

@@ -1,9 +1,8 @@
import find from "lodash/find";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
import styled from "styled-components";
import { IntegrationType } from "@shared/types";
import { IntegrationService, IntegrationType } from "@shared/types";
import Collection from "~/models/Collection";
import Integration from "~/models/Integration";
import Button from "~/components/Button";
@@ -38,14 +37,15 @@ function Slack() {
});
}, [collections, integrations]);
const commandIntegration = find(
integrations.slackIntegrations,
(i) => i.type === IntegrationType.Command
);
const commandIntegration = integrations.find({
type: IntegrationType.Command,
service: IntegrationService.Slack,
});
const groupedCollections = collections.orderedData
.map<[Collection, Integration | undefined]>((collection) => {
const integration = find(integrations.slackIntegrations, {
const integration = integrations.find({
service: IntegrationService.Slack,
collectionId: collection.id,
});