Skip to content

Commit

Permalink
Fix react async component
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Dec 5, 2024
1 parent 7e4c9e0 commit eee4903
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/components/MainList.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -16,10 +16,10 @@ const openOptionsPage = async (): Promise<void> => {
await browser.runtime.openOptionsPage();
};

export default async function MainList({
export default function MainList({
loggingEnabled,
totalTimeLoggedToday,
}: MainListProps): Promise<JSX.Element> {
}: MainListProps): JSX.Element {
const dispatch = useDispatch();

const user: User | undefined = useSelector(
Expand Down Expand Up @@ -54,8 +54,6 @@ export default async function MainList({
</div>
) : null;

const url = await getWebsiteUrl();

return (
<div>
{user ? (
Expand Down Expand Up @@ -122,7 +120,7 @@ export default async function MainList({
<a
target="_blank"
rel="noreferrer"
href={`${url}/login`}
href="https://wakatime.com/login"
className="list-group-item text-body-secondary"
>
<i className="fa fa-fw fa-sign-in me-2" />
Expand Down

0 comments on commit eee4903

Please sign in to comment.