running bots refresh (#61)

This commit is contained in:
Egor Gripasov 2020-12-16 13:39:02 +03:00 committed by GitHub
parent aad1236469
commit befcd90558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -3,7 +3,7 @@
//
import moment from 'moment';
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useContext } from 'react';
import { useQuery, useMutation } from '@apollo/react-hooks';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
@ -12,7 +12,7 @@ import TableBody from '@material-ui/core/TableBody';
import BOT_LIST from '../../../gql/bot_list.graphql';
import BOT_KILL from '../../../gql/bot_kill.graphql';
import { useQueryStatusReducer, useStatusReducer, useSorter } from '../../../hooks';
import { ConsoleContext, useQueryStatusReducer, useStatusReducer, useSorter } from '../../../hooks';
import BotControls from '../../../components/BotControls';
import Table from '../../../components/Table';
@ -22,8 +22,9 @@ const RunningBots = () => {
const [sorter, sortBy] = useSorter('started', false);
const [botList, setBotList] = useState([]);
const [, setStatus] = useStatusReducer();
const { config } = useContext(ConsoleContext);
const { data: botListResponse, refetch } = useQueryStatusReducer(useQuery(BOT_LIST));
const { data: botListResponse, refetch } = useQueryStatusReducer(useQuery(BOT_LIST, { pollInterval: config.api.pollInterval }));
useEffect(() => {
if (botListResponse) {

View File

@ -1,7 +1,7 @@
{
"build": {
"name": "@dxos/console-app",
"buildDate": "2020-12-10T18:33:21.012Z",
"version": "1.2.7-alpha.0"
"buildDate": "2020-12-16T09:52:39.755Z",
"version": "1.2.7-alpha.2"
}
}