fix: resolved error in org settings and integrations page alert hidden on no integrations

This commit is contained in:
Akhil Mohan
2023-11-02 14:39:13 +05:30
parent 1be46b5e57
commit abbeb67b95
9 changed files with 91 additions and 98 deletions
@@ -1,6 +1,7 @@
import { createContext, ReactNode, useContext } from "react";
import { useGetUserOrgPermissions } from "@app/hooks/api";
import { OrgUser } from "@app/hooks/api/types";
import { useOrganization } from "../OrganizationContext";
import { TOrgPermission } from "./types";
@@ -9,7 +10,10 @@ type Props = {
children: ReactNode;
};
const OrgPermissionContext = createContext<null | TOrgPermission>(null);
const OrgPermissionContext = createContext<null | {
permission: TOrgPermission;
membership: OrgUser | null;
}>(null);
export const OrgPermissionProvider = ({ children }: Props): JSX.Element => {
const { currentOrg } = useOrganization();