diff --git a/src/components/MainList.tsx b/src/components/MainList.tsx index 3a84e60..879f177 100644 --- a/src/components/MainList.tsx +++ b/src/components/MainList.tsx @@ -6,6 +6,7 @@ import { userLogout } from '../reducers/currentUser'; import { ReduxSelector } from '../types/store'; import { User } from '../types/user'; import changeExtensionState from '../utils/changeExtensionStatus'; +import { getWebsiteUrl } from '../utils/settings'; export interface MainListProps { loggingEnabled: boolean; @@ -15,10 +16,10 @@ const openOptionsPage = async (): Promise => { await browser.runtime.openOptionsPage(); }; -export default function MainList({ +export default async function MainList({ loggingEnabled, totalTimeLoggedToday, -}: MainListProps): JSX.Element { +}: MainListProps): Promise { const dispatch = useDispatch(); const user: User | undefined = useSelector( @@ -53,6 +54,8 @@ export default function MainList({ ) : null; + const url = await getWebsiteUrl(); + return (
{user ? ( @@ -119,7 +122,7 @@ export default function MainList({ diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 05d1f88..305050d 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -2,8 +2,9 @@ import React from 'react'; import { useSelector } from 'react-redux'; import { ReduxSelector } from '../types/store'; import { User } from '../types/user'; +import { getWebsiteUrl } from '../utils/settings'; -export default function NavBar(): JSX.Element { +export default async function NavBar(): Promise> { const user: User | undefined = useSelector( (selector: ReduxSelector) => selector.currentUser.user, ); @@ -20,13 +21,14 @@ export default function NavBar(): JSX.Element { } }; - const customRules = () => { + const customRules = async () => { if (user) { + const url = await getWebsiteUrl(); return (
  • @@ -40,13 +42,14 @@ export default function NavBar(): JSX.Element { } }; - const dashboard = () => { + const dashboard = async () => { if (user) { + const url = await getWebsiteUrl(); return (
  • @@ -84,8 +87,8 @@ export default function NavBar(): JSX.Element {
    {signedInAs()}