Skip to content

Commit b3d3b8b

Browse files
authored
fix: Stop multiple buttons from compounding in the workspace action dropdown (#3482)
The variadic function on an object doesn't clone the inner array. This was causing the `secondary` property to accumulate more and more button types as time went on! Fixes #3154.
1 parent 16c12e9 commit b3d3b8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/src/components/WorkspaceActions/WorkspaceActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
6868
// if an update is available, we make the update button the primary CTA
6969
// and move the former primary CTA to the secondary actions list
7070
const updatedActions = { ...WorkspaceStateActions[workspaceState] }
71-
updatedActions.secondary.unshift(updatedActions.primary)
71+
updatedActions.secondary = [updatedActions.primary, ...updatedActions.secondary]
7272
updatedActions.primary = ButtonTypesEnum.update
7373

7474
return updatedActions

0 commit comments

Comments
 (0)