Skip to content

Commit 6e55a43

Browse files
committed
Fix bug in async react component
1 parent 87d76c9 commit 6e55a43

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/components/NavBar.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import React from 'react';
22
import { useSelector } from 'react-redux';
33
import { ReduxSelector } from '../types/store';
44
import { User } from '../types/user';
5-
import { getWebsiteUrl } from '../utils/settings';
65

7-
export default async function NavBar(): Promise<Promise<JSX.Element>> {
6+
export default function NavBar(): JSX.Element {
87
const user: User | undefined = useSelector(
98
(selector: ReduxSelector) => selector.currentUser.user,
109
);
@@ -21,9 +20,9 @@ export default async function NavBar(): Promise<Promise<JSX.Element>> {
2120
}
2221
};
2322

24-
const customRules = async () => {
23+
const customRules = () => {
2524
if (user) {
26-
const url = await getWebsiteUrl();
25+
const url = 'https://wakatime.com';
2726
return (
2827
<li className="mb-2">
2928
<a
@@ -42,9 +41,9 @@ export default async function NavBar(): Promise<Promise<JSX.Element>> {
4241
}
4342
};
4443

45-
const dashboard = async () => {
44+
const dashboard = () => {
4645
if (user) {
47-
const url = await getWebsiteUrl();
46+
const url = 'https://wakatime.com';
4847
return (
4948
<li className="mb-2">
5049
<a
@@ -87,8 +86,8 @@ export default async function NavBar(): Promise<Promise<JSX.Element>> {
8786
<div className="collapse navbar-collapse mt-4" id="userInfoCollapse">
8887
{signedInAs()}
8988
<ul className="nav navbar-nav border-bottom pb-2">
90-
{await customRules()}
91-
{await dashboard()}
89+
{customRules()}
90+
{dashboard()}
9291
<li className="dropdown">
9392
<a
9493
href="#"

0 commit comments

Comments
 (0)