fix render issue
This commit is contained in:
@@ -13,7 +13,7 @@ const MainNavigation = () => {
|
||||
<li>
|
||||
<Link to="/">Home</Link>
|
||||
</li>
|
||||
{user ? (
|
||||
{ user && user.profile ? (
|
||||
<div>
|
||||
<h1>{user.profile.name}</h1>
|
||||
<button onClick={logout}>Logout</button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import {fetchWithCache} from "../utils/fetchWIthCache";
|
||||
import {fetchWithCache} from "../utils/fetchWithCache";
|
||||
|
||||
const MarkdownContent = () => {
|
||||
const { id } = useParams();
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import "./SideNavigation.css";
|
||||
import { fetchWithCache } from "../utils/fetchWithCache";
|
||||
import {fetchWithCache} from "../utils/fetchWithCache";
|
||||
|
||||
const SideNavigation = () => {
|
||||
const [markdowns, setMarkdowns] = useState([]);
|
||||
const [tree, setTree] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
fetchWithCache("/api/markdown/")
|
||||
fetchWithCache("http://127.0.0.1:5000/api/markdown/")
|
||||
.then((data) => {
|
||||
setMarkdowns(data);
|
||||
setTree(buildTree(data));
|
||||
@@ -44,7 +44,7 @@ const SideNavigation = () => {
|
||||
if (value.markdown) {
|
||||
return (
|
||||
<li key={value.markdown.id}>
|
||||
<Link to={`/markdown/${value.markdown.id}`}>
|
||||
<Link to={`http://127.0.0.1:5000/markdown/${value.markdown.id}`}>
|
||||
{value.markdown.title}
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user