mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 15:26:06 +00:00
fix: remove unnecessary useEffect
This commit is contained in:
@@ -101,8 +101,6 @@ export const ShareSecretsRow = ({
|
||||
<p className="text-xs text-gray-500">{formatDate(row.expiresAt)}</p>
|
||||
</Td>
|
||||
<Td>
|
||||
|
||||
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
handlePopUpOpen("deleteSharedSecretConfirmation", {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { faKey } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
import {
|
||||
@@ -12,7 +11,7 @@ import {
|
||||
THead,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { TSharedSecret, useGetSharedSecrets } from "@app/hooks/api/secretSharing";
|
||||
import { useGetSharedSecrets } from "@app/hooks/api/secretSharing";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
import { ShareSecretsRow } from "./ShareSecretsRow";
|
||||
@@ -31,19 +30,11 @@ type Props = {
|
||||
};
|
||||
|
||||
export const ShareSecretsTable = ({ handlePopUpOpen }: Props) => {
|
||||
const [tableData, setTableData] = useState<TSharedSecret[]>([]);
|
||||
const { isLoading, data = [] } = useGetSharedSecrets();
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoading) {
|
||||
setTableData(data);
|
||||
}
|
||||
}, [isLoading, data]);
|
||||
|
||||
let tableData = data.filter((secret) => !secret.expiresAt || new Date(secret.expiresAt) > new Date())
|
||||
const handleSecretExpiration = () => {
|
||||
setTableData(
|
||||
data.filter((secret) => !secret.expiresAt || new Date(secret.expiresAt) > new Date())
|
||||
);
|
||||
tableData = data.filter((secret) => !secret.expiresAt || new Date(secret.expiresAt) > new Date());
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user