mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-24 13:02:21 +00:00
fix loop in phone numbers page
This commit is contained in:
@@ -98,7 +98,7 @@ const CarriersList = () => {
|
||||
console.log(err.response || err);
|
||||
}
|
||||
}
|
||||
}, [currentServiceProvider]);
|
||||
}, [currentServiceProvider, history, dispatch]);
|
||||
|
||||
//=============================================================================
|
||||
// Delete sip trunk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect, useContext } from 'react';
|
||||
import React, { useState, useEffect, useContext, useCallback } from 'react';
|
||||
import axios from 'axios';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { NotificationDispatchContext } from '../../../contexts/NotificationContext';
|
||||
@@ -14,12 +14,12 @@ const PhoneNumbersList = () => {
|
||||
|
||||
useEffect(() => {
|
||||
document.title = `Phone Number Routing | Jambonz | Open Source CPAAS`;
|
||||
});
|
||||
}, []);
|
||||
|
||||
//=============================================================================
|
||||
// Get phone numbers
|
||||
//=============================================================================
|
||||
const getPhoneNumbers = async () => {
|
||||
const getPhoneNumbers = useCallback(async () => {
|
||||
try {
|
||||
if (!localStorage.getItem('token')) {
|
||||
history.push('/');
|
||||
@@ -124,7 +124,7 @@ const PhoneNumbersList = () => {
|
||||
console.log(err.response || err);
|
||||
}
|
||||
}
|
||||
};
|
||||
}, [currentServiceProvider, dispatch, history]);
|
||||
|
||||
//=============================================================================
|
||||
// Delete phone number
|
||||
|
||||
Reference in New Issue
Block a user