Skip to content

Commit

Permalink
Hide the selected spectrum after logout
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed Nov 19, 2024
1 parent e563c24 commit 004d75d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/SearchComp/SearchComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { AnimatePresence, motion } from "framer-motion";
import { useState } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { useAuth } from "react-oidc-context";

import { useLocation } from "react-router-dom";
import Chart from "../Chart/Chart";
import SideBarToggle from "../Icons/SideBarToggle";
Expand All @@ -26,6 +28,8 @@ export default function SearchComp({ setDomain }) {

let isNexusFile = false;

const auth = useAuth();

let [reference, setReference] = useState("*");
let [provider, setProvider] = useState("*");
let [pages, setPages] = useState("0");
Expand Down Expand Up @@ -126,7 +130,7 @@ export default function SearchComp({ setDomain }) {
/>
</ErrorBoundary>
</Expander>
{imageSelected ? (
{imageSelected && auth.isAuthenticated ? (
// <ErrorBoundary
// fallback={
// <div className="errorMessage">
Expand All @@ -145,7 +149,7 @@ export default function SearchComp({ setDomain }) {
) : (
// </ErrorBoundary>
<div className="errorMessage">
<p>No image selected</p>
{auth.isAuthenticated && <p>No image selected</p>}
</div>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const oidcConfig = {
authority: "https://iam.ideaconsult.net/auth/realms/nano",
client_id: "idea-ui",
redirect_uri: window.location.origin + "/search/",
post_logout_redirect_uri: "https://iam.ideaconsult.net/",
response_type: "code",
scope: "openid profile email",
};
Expand Down

0 comments on commit 004d75d

Please sign in to comment.