From eee490387f2343006f56391b5accdb498be758c7 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 5 Dec 2024 12:35:46 +0100 Subject: [PATCH] Fix react async component --- src/components/MainList.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/MainList.tsx b/src/components/MainList.tsx index 879f177..8803105 100644 --- a/src/components/MainList.tsx +++ b/src/components/MainList.tsx @@ -1,12 +1,12 @@ +import React from 'react'; + import { useDispatch, useSelector } from 'react-redux'; -import React from 'react'; import { configLogout, setLoggingEnabled } from '../reducers/configReducer'; -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'; +import { userLogout } from '../reducers/currentUser'; export interface MainListProps { loggingEnabled: boolean; @@ -16,10 +16,10 @@ const openOptionsPage = async (): Promise => { await browser.runtime.openOptionsPage(); }; -export default async function MainList({ +export default function MainList({ loggingEnabled, totalTimeLoggedToday, -}: MainListProps): Promise { +}: MainListProps): JSX.Element { const dispatch = useDispatch(); const user: User | undefined = useSelector( @@ -54,8 +54,6 @@ export default async function MainList({ ) : null; - const url = await getWebsiteUrl(); - return (
{user ? ( @@ -122,7 +120,7 @@ export default async function MainList({