Skip to content

Commit

Permalink
Fix token
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Aug 26, 2024
1 parent e8d2599 commit 76c878b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ <h2 className="text-xl font-semibold text-white">Annotated Images ({annotationsL
)}

{activeTab === "Community Annotations" && (
<CommunityAnnotations serverUrl={serverUrl} token={user.token} />
<CommunityAnnotations serverUrl={serverUrl} />
)}
</div>

Expand Down Expand Up @@ -695,12 +695,15 @@ <h1 className="text-xl font-semibold mb-4 text-center"><i className="fas fa-proj
);
}

function CommunityAnnotations({ serverUrl, token }) {
function CommunityAnnotations({ serverUrl }) {
const [token, setToken] = useState(localStorage.getItem("token"));
const [annotationServices, setAnnotationServices] = useState([]);

useEffect(() => {
const fetchAnnotations = async () => {
try {
const token = localStorage.getItem("token");
setToken(token);
const server = await hyphaWebsocketClient.connectToServer({
"server_url": serverUrl,
"token": token,
Expand All @@ -714,7 +717,7 @@ <h1 className="text-xl font-semibold mb-4 text-center"><i className="fas fa-proj
};

fetchAnnotations();
}, [serverUrl, token]);
}, [serverUrl]);

return (
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
Expand Down

0 comments on commit 76c878b

Please sign in to comment.