From 6e55a43cb5872e5ed1ce1e3f2485e8b0d949e320 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 5 Dec 2024 12:44:22 +0100 Subject: [PATCH] Fix bug in async react component --- src/components/NavBar.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 305050d..dfc46b4 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -2,9 +2,8 @@ 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 async function NavBar(): Promise> { +export default function NavBar(): JSX.Element { const user: User | undefined = useSelector( (selector: ReduxSelector) => selector.currentUser.user, ); @@ -21,9 +20,9 @@ export default async function NavBar(): Promise> { } }; - const customRules = async () => { + const customRules = () => { if (user) { - const url = await getWebsiteUrl(); + const url = 'https://wakatime.com'; return (
  • > { } }; - const dashboard = async () => { + const dashboard = () => { if (user) { - const url = await getWebsiteUrl(); + const url = 'https://wakatime.com'; return (
  • > {
    {signedInAs()}
      - {await customRules()} - {await dashboard()} + {customRules()} + {dashboard()}