Merge branch 'master' of github.com:Nek/backstage
This commit is contained in:
@@ -22,8 +22,9 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||
import { PluginHeader } from '../../components/PluginHeader';
|
||||
import { ActionOutput } from './lib/ActionOutput/ActionOutput';
|
||||
import { Layout } from '../../components/Layout';
|
||||
import { useBuildWithSteps, useSettings } from '../../state';
|
||||
import LaunchIcon from '@material-ui/icons/Launch';
|
||||
import { useSettings } from '../../state/useSettings';
|
||||
import { useBuildWithSteps } from '../../state/useBuildWithSteps';
|
||||
|
||||
const IconLink = IconButton as typeof Link;
|
||||
const BuildName: FC<{ build?: BuildWithSteps }> = ({ build }) => (
|
||||
|
||||
@@ -14,6 +14,3 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export * from './AppState';
|
||||
export * from './useBuildWithSteps';
|
||||
export * from './useBuilds';
|
||||
export * from './useSettings';
|
||||
|
||||
@@ -33,5 +33,5 @@ export const useAsyncPolling = (
|
||||
const stopPolling = () => {
|
||||
isPolling.current = false;
|
||||
};
|
||||
return { isPolling, startPolling, stopPolling };
|
||||
return { startPolling, stopPolling };
|
||||
};
|
||||
|
||||
@@ -44,6 +44,11 @@ export function useBuildWithSteps(buildId: number) {
|
||||
}
|
||||
}, [token, owner, repo, buildId]);
|
||||
|
||||
const { startPolling, stopPolling } = useAsyncPolling(
|
||||
getBuildWithSteps,
|
||||
INTERVAL_AMOUNT,
|
||||
);
|
||||
|
||||
const restartBuild = async () => {
|
||||
try {
|
||||
await api.retry(buildId, {
|
||||
|
||||
@@ -103,6 +103,11 @@ export function useBuilds() {
|
||||
[repo, token, owner],
|
||||
);
|
||||
|
||||
const { startPolling, stopPolling } = useAsyncPolling(
|
||||
getBuilds,
|
||||
INTERVAL_AMOUNT,
|
||||
);
|
||||
|
||||
const restartBuild = async (buildId: number) => {
|
||||
try {
|
||||
await api.retry(buildId, {
|
||||
|
||||
Reference in New Issue
Block a user