Skip to content

Commit df32ba0

Browse files
authored
feat(UI-1453): clear logs after organization switch (#1122)
1 parent 92c9149 commit df32ba0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/organisms/settings/organization/switchOrganization.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react";
33
import { useTranslation } from "react-i18next";
44
import { useNavigate, useParams } from "react-router-dom";
55

6-
import { useOrganizationStore, useProjectStore } from "@src/store";
6+
import { useOrganizationStore, useProjectStore, useLoggerStore } from "@src/store";
77

88
import { Loader, Typography } from "@components/atoms";
99

@@ -14,6 +14,7 @@ export const SwitchOrganization = () => {
1414
const { organizations, setCurrentOrganization, currentOrganization, getEnrichedOrganizations } =
1515
useOrganizationStore();
1616
const { getProjectsList } = useProjectStore();
17+
const { clearLogs } = useLoggerStore();
1718
const navigate = useNavigate();
1819
const [organizationName, setOrganizationName] = useState(currentOrganization?.displayName);
1920

@@ -50,6 +51,7 @@ export const SwitchOrganization = () => {
5051
if (organizationFromStore) {
5152
setCurrentOrganization(organizationFromStore);
5253
setOrganizationName(organizationFromStore.displayName);
54+
clearLogs();
5355
loadProjects();
5456
return true;
5557
}

0 commit comments

Comments
 (0)