Skip to content

Commit

Permalink
Merge pull request #957 from jennydaman/hotfix-singleplugin
Browse files Browse the repository at this point in the history
Hotfix: browse SinglePlugin anonymously
  • Loading branch information
jennydaman committed Oct 9, 2023
2 parents 01f1a86 + a26cbc4 commit b02ad83
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pages/SinglePluginPage/SinglePlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import {
HeaderSinglePlugin,
ParameterPayload,
} from "../../components/catalog/PluginCatalogComponents";
import { useTypedSelector } from "../../store/hooks";

const SinglePlugin = () => {
const isLoggedIn = useTypedSelector(({ user }) => user.isLoggedIn);
const { id } = useParams() as { id: string };

const [readme, setReadme] = React.useState<string>("");
Expand Down Expand Up @@ -77,13 +79,11 @@ const SinglePlugin = () => {
boundFn
);

const { resource: computes } = await fetchResource(params, boundComputeFn);
const pluginInstancesList = await plugin.getPluginInstances({
limit: 20,
});
const { resource: computes } = isLoggedIn ? await fetchResource(params, boundComputeFn) : {resource: []};

const pluginInstances: PluginInstance[] =
pluginInstancesList.getItems() as PluginInstance[];
const pluginInstances = isLoggedIn ? (await plugin.getPluginInstances({
limit: 20,
})).getItems() as PluginInstance[] : [];

if (parameters.length > 0) {
parameters.forEach((param) => {
Expand Down

0 comments on commit b02ad83

Please sign in to comment.