From 7ab735d9c4d9c8b1f3e766e9bb6e411b8dcc8183 Mon Sep 17 00:00:00 2001 From: Michael Myers Date: Wed, 29 Jan 2025 11:26:39 -0600 Subject: [PATCH] Use updateRole only when roleDiffProps exist --- .../teleport/src/Roles/RoleEditor/RoleEditorAdapter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/packages/teleport/src/Roles/RoleEditor/RoleEditorAdapter.tsx b/web/packages/teleport/src/Roles/RoleEditor/RoleEditorAdapter.tsx index dc3c2a1b70563..d616dd61c0701 100644 --- a/web/packages/teleport/src/Roles/RoleEditor/RoleEditorAdapter.tsx +++ b/web/packages/teleport/src/Roles/RoleEditor/RoleEditorAdapter.tsx @@ -70,7 +70,7 @@ export function RoleEditorAdapter({ }, [originalContent]); const onRoleUpdate = useCallback( - debounce(roleDiffProps.updateRoleDiff, 500), + debounce(role => roleDiffProps?.updateRoleDiff(role), 500), [] );