Skip to content

Commit

Permalink
remove unused state
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-cvit committed Sep 29, 2024
1 parent 5ae134e commit 9d47701
Showing 1 changed file with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const PodLogs = ({ pod }: PodLogsProps) => {
initContainers: [],
});

//
const [, setLogsSignalController] = useState<AbortController | null>(null);

const [error, setError] = useState({
message: "",
description: "",
Expand All @@ -37,13 +34,6 @@ const PodLogs = ({ pod }: PodLogsProps) => {
initContainers: [],
});
setLogs([]);
setLogsSignalController((prevController) => {
if (prevController) {
prevController.abort();
}

return null;
});
};

const getTabItems = () => {
Expand Down Expand Up @@ -116,14 +106,7 @@ const PodLogs = ({ pod }: PodLogsProps) => {

const onLogsTabsChange = (container: string) => {
const controller = new AbortController();
setLogsSignalController((prevController) => {
if (prevController) {
prevController.abort();
}

return controller;
});
setLogs(() => []); //this is to remove the previous pod's logs
setLogs(() => []);

if (isStreamingEnabled()) {
logStream(
Expand Down Expand Up @@ -174,8 +157,6 @@ const PodLogs = ({ pod }: PodLogsProps) => {
onClick={function () {
if (isStreamingEnabled()) {
const controller = new AbortController();
setLogsSignalController(() => controller);

logStream(
pod.name,
pod.namespace,
Expand Down

0 comments on commit 9d47701

Please sign in to comment.