add early return
This commit is contained in:
1 parent
dec12cc6ab
commit
d8c0839391
1 file changed
+4
-1
@@ -59,6 +59,9 @@ const useSubscribeToDetails = ({ monitorId, dateRange }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
|
if (typeof monitorId === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const cleanup = networkService.subscribeToDistributedUptimeDetails({
|
const cleanup = networkService.subscribeToDistributedUptimeDetails({
|
||||||
authToken,
|
authToken,
|
||||||
monitorId,
|
monitorId,
|
||||||
@@ -116,4 +119,4 @@ const useSubscribeToDetails = ({ monitorId, dateRange }) => {
|
|||||||
return [isLoading, networkError, connectionStatus, monitor, lastUpdateTrigger];
|
return [isLoading, networkError, connectionStatus, monitor, lastUpdateTrigger];
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useSubscribeToDetails;
|
export { useSubscribeToDetails };
|
||||||
Reference in new issue
Block a user