Skip to content

Commit

Permalink
Merge pull request novuhq#2160 from novuhq/nv-1278-does-not-take-the-…
Browse files Browse the repository at this point in the history
…active-integration

feat: change to active integrations for preview
  • Loading branch information
davidsoderberg authored Dec 4, 2022
2 parents 3bbe2cc + 8ef13c0 commit d982fe5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { EmailMessageEditor } from './EmailMessageEditor';
import { EmailCustomCodeEditor } from './EmailCustomCodeEditor';
import { LackIntegrationError } from '../LackIntegrationError';
import { useEnvController } from '../../../store/use-env-controller';
import { useIntegrations } from '../../../api/hooks';
import { useActiveIntegrations } from '../../../api/hooks';
import { EmailInboxContent } from './EmailInboxContent';

const EDITOR = 'Editor';
Expand All @@ -26,7 +26,7 @@ export function EmailContentCard({
const { control, setValue, watch } = useFormContext(); // retrieve all hook methods
const contentType = watch(`steps.${index}.template.contentType`);
const [activeTab, setActiveTab] = useState<string | null>(EDITOR);
const { integrations = [] } = useIntegrations();
const { integrations = [] } = useActiveIntegrations();
const [integration, setIntegration]: any = useState(null);

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/pages/templates/editor/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
import { useFormContext, useWatch } from 'react-hook-form';
import { useMutation } from 'react-query';
import { previewEmail } from '../../../api/content-templates';
import { useIntegrations } from '../../../api/hooks';
import { useActiveIntegrations } from '../../../api/hooks';
import { When } from '../../../components/utils/When';
import { Button, colors } from '../../../design-system';
import { inputStyles } from '../../../design-system/config/inputs.styles';
Expand Down Expand Up @@ -37,7 +37,7 @@ export const Preview = ({ activeStep, view }: { activeStep: number; view: string
control,
});

const { integrations = [] } = useIntegrations();
const { integrations = [] } = useActiveIntegrations();
const [integration, setIntegration]: any = useState(null);
const [content, setContent] = useState<string>('<html><head></head><body><div></div></body></html>');
const { isLoading, mutateAsync } = useMutation(previewEmail);
Expand Down

0 comments on commit d982fe5

Please sign in to comment.