Skip to content

Commit

Permalink
remove dropdown on Sources table with extentable object (#3854)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshri committed Jul 19, 2023
1 parent 3d23bf4 commit a0146ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/components/CheckboxActions.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Tooltip } from "@material-ui/core";
import _ from "lodash";
import * as React from "react";
import { useLocation } from "react-router-dom";
import styled from "styled-components";
import { useSyncFluxObject } from "../hooks/automations";
import { useToggleSuspend } from "../hooks/flux";
import { ObjectRef } from "../lib/api/core/types.pb";
import { V2Routes } from "../lib/types";
import Button from "./Button";
import Flex from "./Flex";
import Icon, { IconType } from "./Icon";
Expand All @@ -29,11 +31,16 @@ export const makeObjects = (checked: string[], rows: any[]): ObjectRef[] => {

const DefaultSync: React.FC<{ reqObjects: ObjectRef[] }> = ({ reqObjects }) => {
const defaultSync = useSyncFluxObject(reqObjects);
const location = useLocation();
const noSource = {
[V2Routes.Sources]: true,
};
return (
<SyncButton
disabled={reqObjects[0] ? false : true}
loading={defaultSync.isLoading}
onClick={(opts) => defaultSync.mutateAsync(opts)}
hideDropdown={noSource[location.pathname]}
/>
);
};
Expand Down

0 comments on commit a0146ed

Please sign in to comment.