mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
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.
This commit is contained in:
@ -68,7 +68,7 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
|
||||
// if an update is available, we make the update button the primary CTA
|
||||
// and move the former primary CTA to the secondary actions list
|
||||
const updatedActions = { ...WorkspaceStateActions[workspaceState] }
|
||||
updatedActions.secondary.unshift(updatedActions.primary)
|
||||
updatedActions.secondary = [updatedActions.primary, ...updatedActions.secondary]
|
||||
updatedActions.primary = ButtonTypesEnum.update
|
||||
|
||||
return updatedActions
|
||||
|
Reference in New Issue
Block a user