Skip to content

Commit

Permalink
fix: reset layout state when navigating to ClustersList
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskari committed Sep 26, 2024
1 parent 96511a9 commit fa1c47b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/Clusters/views/ClusterList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react';
import { useEffect, useState } from 'react';
import jsyaml from 'js-yaml';
import { saveAs } from 'file-saver';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -28,6 +28,7 @@ import './ClusterList.scss';
import { useSetRecoilState } from 'recoil';
import { showAddClusterWizard } from 'state/showAddClusterWizard';
import { EmptyListComponent } from 'shared/components/EmptyListComponent/EmptyListComponent';
import { columnLayoutState } from 'state/columnLayoutAtom';

function ClusterList() {
const gardenerLoginFeature = useFeature('GARDENER_LOGIN');
Expand All @@ -45,6 +46,15 @@ function ClusterList() {

const [chosenCluster, setChosenCluster] = useState(null);
const setShowAdd = useSetRecoilState(showAddClusterWizard);
const setLayoutColumn = useSetRecoilState(columnLayoutState);

useEffect(() => {
setLayoutColumn({
layout: 'OneColumn',
midColumn: null,
endColumn: null,
});
}, [setLayoutColumn]);

const [toggleFormFn, getToggleFormFn] = useState(() => {});
const [editedCluster, setEditedCluster] = useState(null);
Expand Down

0 comments on commit fa1c47b

Please sign in to comment.