Skip to content

Commit ab14500

Browse files
reload list of keys after change the cluster
1 parent 1b5d423 commit ab14500

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

app/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default function Home() {
107107
<div>Select a key to view details</div>
108108
</div>
109109
)}
110-
<Cluster />
110+
<Cluster onChange={() => loadKeys("", "", true)} />
111111
</div>
112112

113113
<DeleteKeyDialog

app/components/cluster.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from "@/components/ui/dialog";
1010
import { cn } from "@/lib/utils";
1111

12-
export default function Cluster() {
12+
export default function Cluster({ onChange }: { onChange?: () => void }) {
1313
const { clusters, listClusters, switchCluster } = useCluster();
1414
const [open, setOpen] = useState(false);
1515

@@ -22,6 +22,7 @@ export default function Cluster() {
2222
const handleSwitch = async (name: string) => {
2323
await switchCluster(name);
2424
setOpen(false);
25+
onChange?.();
2526
};
2627

2728
if (!activeCluster && clusters.length === 0) return null;

0 commit comments

Comments
 (0)