Skip to content

Commit

Permalink
ui: avoid exceptions if organizations list and request membership are…
Browse files Browse the repository at this point in the history
… not defined
  • Loading branch information
ptamarit committed Oct 18, 2024
1 parent 60fa30d commit 13a016c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import React from "react";
import { RequestMembershipButton } from "./RequestMembershipButton";

const organizationsContainer = document.getElementById("organizations-list");
const organizations = JSON.parse(organizationsContainer.dataset.organizations);

if (organizationsContainer) {
const organizations = JSON.parse(organizationsContainer.dataset.organizations);
ReactDOM.render(
<OrganizationsList organizations={organizations} />,
organizationsContainer
Expand All @@ -24,8 +24,7 @@ if (organizationsContainer) {

const domContainer = document.getElementById("request-membership-app");

const community = JSON.parse(domContainer.dataset.community);

if (domContainer) {
const community = JSON.parse(domContainer.dataset.community);
ReactDOM.render(<RequestMembershipButton community={community} />, domContainer);
}

0 comments on commit 13a016c

Please sign in to comment.