Skip to content

Commit

Permalink
Fix pause button not working (#1372)
Browse files Browse the repository at this point in the history
  • Loading branch information
goodoldneon committed May 18, 2024
1 parent c9ecb28 commit e51e6fd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export type FunctionTableRow = {
appName: string | null;
name: string;
isArchived: boolean;
isActive: boolean;
isPaused: boolean;
slug: string;
triggers: Trigger[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const FunctionVersionNumberDocument = graphql(`
workspace(id: $environmentID) {
workflow: workflowBySlug(slug: $slug) {
id
isPaused
name
archivedAt
current {
Expand Down Expand Up @@ -135,7 +136,7 @@ export default function PauseFunctionButton({ functionSlug, disabled }: PauseFun
return null;
}

const isPaused = !fn.current && !fn.archivedAt;
const { isPaused } = fn;

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export default function FunctionLayout({ children, params }: FunctionLayoutProps
const env = useEnvironment();

const fn = data?.workspace.workflow;
const { isArchived = false } = fn ?? {};
const isPaused = !isArchived && !data?.workspace.workflow?.current;
const { isArchived = false, isPaused } = fn ?? {};

const isNewRunsEnabled = useBooleanFlag('new-runs');

Expand Down

0 comments on commit e51e6fd

Please sign in to comment.