From 996a11f5e346ad96b41983ac5278f376ce6a1c16 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 22 Sep 2022 22:49:37 -0400 Subject: [PATCH] fix: Incorrect integration settings for Draw.IO being used --- app/scenes/Settings/Drawio.tsx | 9 +++++---- app/scenes/Settings/Slack.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/scenes/Settings/Drawio.tsx b/app/scenes/Settings/Drawio.tsx index 6fe578185..6a2df1b2e 100644 --- a/app/scenes/Settings/Drawio.tsx +++ b/app/scenes/Settings/Drawio.tsx @@ -1,4 +1,3 @@ -import { head } from "lodash"; import { observer } from "mobx-react"; import { BuildingBlocksIcon } from "outline-icons"; import * as React from "react"; @@ -32,9 +31,11 @@ function Drawio() { }); }, [integrations]); - const integration = head(integrations.orderedData) as - | Integration - | undefined; + const integration = integrations.orderedData.find( + (integration) => + integration.type === IntegrationType.Embed && + integration.service === SERVICE_NAME + ) as Integration | undefined; const { register, handleSubmit: formHandleSubmit, formState } = useForm< FormData diff --git a/app/scenes/Settings/Slack.tsx b/app/scenes/Settings/Slack.tsx index c37f4bee7..48e92caee 100644 --- a/app/scenes/Settings/Slack.tsx +++ b/app/scenes/Settings/Slack.tsx @@ -40,7 +40,7 @@ function Slack() { const commandIntegration = find( integrations.slackIntegrations, - (i) => i.type === "command" + (i) => i.type === IntegrationType.Command ); const groupedCollections = collections.orderedData