remove old loading state
This commit is contained in:
1 parent
424f9bd778
commit
4fec00334a
3 files changed
+8
-13
No files matched your search
@@ -18,7 +18,7 @@ const ActionsMenu = ({
|
|||||||
isAdmin,
|
isAdmin,
|
||||||
updateRowCallback,
|
updateRowCallback,
|
||||||
pauseCallback,
|
pauseCallback,
|
||||||
setIsLoading,
|
setIsLoading = () => {},
|
||||||
}) => {
|
}) => {
|
||||||
const [anchorEl, setAnchorEl] = useState(null);
|
const [anchorEl, setAnchorEl] = useState(null);
|
||||||
const [actions, setActions] = useState({});
|
const [actions, setActions] = useState({});
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ import PropTypes from "prop-types";
|
|||||||
const UptimeDataTable = ({
|
const UptimeDataTable = ({
|
||||||
isAdmin,
|
isAdmin,
|
||||||
isSearching,
|
isSearching,
|
||||||
setIsLoading,
|
|
||||||
filteredMonitors,
|
filteredMonitors,
|
||||||
sort,
|
sort,
|
||||||
setSort,
|
setSort,
|
||||||
@@ -167,7 +166,6 @@ const UptimeDataTable = ({
|
|||||||
monitor={row.monitor}
|
monitor={row.monitor}
|
||||||
isAdmin={isAdmin}
|
isAdmin={isAdmin}
|
||||||
updateRowCallback={triggerUpdate}
|
updateRowCallback={triggerUpdate}
|
||||||
setIsLoading={setIsLoading}
|
|
||||||
pauseCallback={triggerUpdate}
|
pauseCallback={triggerUpdate}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -206,12 +204,10 @@ UptimeDataTable.propTypes = {
|
|||||||
isSearching: PropTypes.bool,
|
isSearching: PropTypes.bool,
|
||||||
setSort: PropTypes.func,
|
setSort: PropTypes.func,
|
||||||
setSearch: PropTypes.func,
|
setSearch: PropTypes.func,
|
||||||
setIsLoading: PropTypes.func,
|
|
||||||
triggerUpdate: PropTypes.func,
|
triggerUpdate: PropTypes.func,
|
||||||
debouncedSearch: PropTypes.string,
|
debouncedSearch: PropTypes.string,
|
||||||
onSearchChange: PropTypes.func,
|
onSearchChange: PropTypes.func,
|
||||||
isAdmin: PropTypes.bool,
|
isAdmin: PropTypes.bool,
|
||||||
isLoading: PropTypes.bool,
|
|
||||||
monitors: PropTypes.array,
|
monitors: PropTypes.array,
|
||||||
filteredMonitors: PropTypes.array,
|
filteredMonitors: PropTypes.array,
|
||||||
monitorCount: PropTypes.number,
|
monitorCount: PropTypes.number,
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ const UptimeMonitors = () => {
|
|||||||
const [page, setPage] = useState(undefined);
|
const [page, setPage] = useState(undefined);
|
||||||
const [sort, setSort] = useState(undefined);
|
const [sort, setSort] = useState(undefined);
|
||||||
const [isSearching, setIsSearching] = useState(false);
|
const [isSearching, setIsSearching] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
const [monitorUpdateTrigger, setMonitorUpdateTrigger] = useState(false);
|
const [monitorUpdateTrigger, setMonitorUpdateTrigger] = useState(false);
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
@@ -107,8 +106,7 @@ const UptimeMonitors = () => {
|
|||||||
order: sort?.order,
|
order: sort?.order,
|
||||||
triggerUpdate: monitorUpdateTrigger,
|
triggerUpdate: monitorUpdateTrigger,
|
||||||
});
|
});
|
||||||
const totalMonitors = monitorsSummary?.totalMonitors ?? 0;
|
const totalMonitors = monitorsSummary?.totalMonitors;
|
||||||
|
|
||||||
if (networkError) {
|
if (networkError) {
|
||||||
return (
|
return (
|
||||||
<GenericFallback>
|
<GenericFallback>
|
||||||
@@ -123,7 +121,10 @@ const UptimeMonitors = () => {
|
|||||||
</GenericFallback>
|
</GenericFallback>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!isLoading && !monitorsAreLoading && totalMonitors === 0) {
|
if (
|
||||||
|
!monitorsAreLoading &&
|
||||||
|
(totalMonitors === 0 || typeof totalMonitors === "undefined")
|
||||||
|
) {
|
||||||
return (
|
return (
|
||||||
<Fallback
|
<Fallback
|
||||||
vowelStart={true}
|
vowelStart={true}
|
||||||
@@ -134,7 +135,6 @@ const UptimeMonitors = () => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
className="monitors"
|
className="monitors"
|
||||||
@@ -143,7 +143,7 @@ const UptimeMonitors = () => {
|
|||||||
<Breadcrumbs list={BREADCRUMBS} />
|
<Breadcrumbs list={BREADCRUMBS} />
|
||||||
<CreateMonitorHeader
|
<CreateMonitorHeader
|
||||||
isAdmin={isAdmin}
|
isAdmin={isAdmin}
|
||||||
shouldRender={!isLoading}
|
shouldRender={!monitorsAreLoading}
|
||||||
path="/uptime/create"
|
path="/uptime/create"
|
||||||
/>
|
/>
|
||||||
<Greeting type="uptime" />
|
<Greeting type="uptime" />
|
||||||
@@ -166,8 +166,7 @@ const UptimeMonitors = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
<UptimeDataTable
|
<UptimeDataTable
|
||||||
isAdmin={isAdmin}
|
isAdmin={isAdmin}
|
||||||
isLoading={isLoading}
|
isLoading={monitorsAreLoading}
|
||||||
setIsLoading={setIsLoading}
|
|
||||||
filteredMonitors={filteredMonitors}
|
filteredMonitors={filteredMonitors}
|
||||||
monitors={monitors}
|
monitors={monitors}
|
||||||
monitorCount={totalMonitors}
|
monitorCount={totalMonitors}
|
||||||
|
|||||||
Reference in new issue
Block a user