fix incidents page
This commit is contained in:
1 parent
d2233d2e3e
commit
c32cde6189
2 files changed
+3
-8
No files matched your search
@@ -24,7 +24,6 @@ const IncidentTable = ({
|
|||||||
}) => {
|
}) => {
|
||||||
//Redux state
|
//Redux state
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
const uiTimezone = useSelector((state) => state.ui.timezone);
|
||||||
const { user } = useSelector((state) => state.auth);
|
|
||||||
|
|
||||||
//Local state
|
//Local state
|
||||||
const [teamId, setTeamId] = useState(undefined);
|
const [teamId, setTeamId] = useState(undefined);
|
||||||
@@ -61,13 +60,13 @@ const IncidentTable = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedMonitor === "0") {
|
if (selectedMonitor === "0") {
|
||||||
setTeamId(user.teamId);
|
setTeamId("placeholder"); // TODO this isn't needed any longer, fix hook
|
||||||
setMonitorId(undefined);
|
setMonitorId(undefined);
|
||||||
} else {
|
} else {
|
||||||
setMonitorId(selectedMonitor);
|
setMonitorId(selectedMonitor);
|
||||||
setTeamId(undefined);
|
setTeamId(undefined);
|
||||||
}
|
}
|
||||||
}, [selectedMonitor, user.teamId]);
|
}, [selectedMonitor]);
|
||||||
|
|
||||||
const headers = [
|
const headers = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import OptionsHeader from "./Components/OptionsHeader";
|
|||||||
//Utils
|
//Utils
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks";
|
import { useFetchMonitorsByTeamId } from "../../Hooks/monitorHooks";
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import NetworkError from "../../Components/GenericFallback/NetworkError";
|
import NetworkError from "../../Components/GenericFallback/NetworkError";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -16,7 +15,6 @@ import { useTranslation } from "react-i18next";
|
|||||||
//Constants
|
//Constants
|
||||||
const Incidents = () => {
|
const Incidents = () => {
|
||||||
// Redux state
|
// Redux state
|
||||||
const { user } = useSelector((state) => state.auth);
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const BREADCRUMBS = [
|
const BREADCRUMBS = [
|
||||||
@@ -31,9 +29,7 @@ const Incidents = () => {
|
|||||||
|
|
||||||
//Utils
|
//Utils
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({
|
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId();
|
||||||
teamId: user.teamId,
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const monitorLookup = monitors?.reduce((acc, monitor) => {
|
const monitorLookup = monitors?.reduce((acc, monitor) => {
|
||||||
|
|||||||
Reference in new issue
Block a user