From d471d052178a6ca81403b8c26c73eda083939416 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 29 Mar 2023 23:08:26 -0700 Subject: [PATCH] Added config to open websites in new tab. --- .../pages/settings/websites/WebsiteSettings.js | 16 +++++++--------- .../pages/settings/websites/WebsitesTable.js | 4 +++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/pages/settings/websites/WebsiteSettings.js b/components/pages/settings/websites/WebsiteSettings.js index dd8b1abe..5a55a36d 100644 --- a/components/pages/settings/websites/WebsiteSettings.js +++ b/components/pages/settings/websites/WebsiteSettings.js @@ -10,23 +10,21 @@ import TrackingCode from 'components/pages/settings/websites/TrackingCode'; import ShareUrl from 'components/pages/settings/websites/ShareUrl'; import useApi from 'hooks/useApi'; import useMessages from 'hooks/useMessages'; +import useConfig from 'hooks/useConfig'; export default function WebsiteSettings({ websiteId }) { const router = useRouter(); const { formatMessage, labels, messages } = useMessages(); - const [values, setValues] = useState(null); - const [tab, setTab] = useState('details'); + const { openExternal } = useConfig(); const { get, useQuery } = useApi(); const { toast, showToast } = useToast(); const { data, isLoading } = useQuery( ['website', websiteId], - () => { - if (websiteId) { - return get(`/websites/${websiteId}`); - } - }, - { cacheTime: 0 }, + () => get(`/websites/${websiteId}`), + { enabled: !!websiteId, cacheTime: 0 }, ); + const [values, setValues] = useState(null); + const [tab, setTab] = useState('details'); const handleSave = data => { showToast({ message: formatMessage(messages.saved), variant: 'success' }); @@ -58,7 +56,7 @@ export default function WebsiteSettings({ websiteId }) { } > - + - +