From ea46619a3736bf9c4d5d22ba2d4962d1085a711e Mon Sep 17 00:00:00 2001 From: Agrim Jain Date: Wed, 8 May 2024 11:49:35 +0400 Subject: [PATCH] fix delete functionality --- .../components/Dialogs/UpdateAppDialog/index.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/features/dashboard/components/Dialogs/UpdateAppDialog/index.tsx b/src/features/dashboard/components/Dialogs/UpdateAppDialog/index.tsx index 1a67eecfb..7f8e8297e 100644 --- a/src/features/dashboard/components/Dialogs/UpdateAppDialog/index.tsx +++ b/src/features/dashboard/components/Dialogs/UpdateAppDialog/index.tsx @@ -18,14 +18,12 @@ const UpdateAppDialog = ({ app, onClose }: IUpdateAppDialog) => { const { send: updateApp, data, error, clear } = useWS('app_update'); const { getApps } = useAppManager(); - const scopes = app ? scopesArrayToObject(app.scopes) : {}; - const initialValues: Partial = app - ? { - ...app, - ...scopes, - app_markup_percentage: String(app.app_markup_percentage), - } - : {}; + const scopes = scopesArrayToObject(app.scopes); + const initialValues: Partial = { + ...app, + ...scopes, + app_markup_percentage: String(app.app_markup_percentage), + }; const onOpenChange = useCallback( (open: boolean) => {