Fix for pagination not updating when selecting a new page
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React, { FC, useState } from 'react';
|
||||
import React, { FC, useState, useEffect } from 'react';
|
||||
import { Table, TableColumn, TrendLine, useApi } from '@backstage/core';
|
||||
import { Website, lighthouseApiRef } from '../../api';
|
||||
import { useInterval } from 'react-use';
|
||||
@@ -55,6 +55,10 @@ export const AuditListTable: FC<{ items: Website[] }> = ({ items }) => {
|
||||
const [websiteState, setWebsiteState] = useState(items);
|
||||
const lighthouseApi = useApi(lighthouseApiRef);
|
||||
|
||||
useEffect(() => {
|
||||
setWebsiteState(items);
|
||||
}, [items]);
|
||||
|
||||
const runRefresh = (websites: Website[]) => {
|
||||
websites.forEach(async website => {
|
||||
const response = await lighthouseApi.getWebsiteForAuditId(
|
||||
|
||||
Reference in New Issue
Block a user