From cc67caea55b2662bc0fbeb5d50dfa8eb55af1b13 Mon Sep 17 00:00:00 2001 From: elraphty Date: Thu, 21 Sep 2023 18:47:12 +0100 Subject: [PATCH] fixed relay user save profile error --- frontend/app/src/people/main/FocusView.tsx | 21 ++++++++++++------- .../editUserModal/EditUserDesktopView.tsx | 1 + .../widgetViews/summaries/WantedSummary.tsx | 1 + frontend/app/src/store/main.ts | 6 ++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/frontend/app/src/people/main/FocusView.tsx b/frontend/app/src/people/main/FocusView.tsx index 68f7dde1b..be34362fa 100644 --- a/frontend/app/src/people/main/FocusView.tsx +++ b/frontend/app/src/people/main/FocusView.tsx @@ -64,9 +64,9 @@ const B = styled.div` overflow-y: auto; box-sizing: border-box; ${EnvWithScrollBar({ - thumbColor: '#5a606c', - trackBackgroundColor: 'rgba(0,0,0,0)' - })} + thumbColor: '#5a606c', + trackBackgroundColor: 'rgba(0,0,0,0)' +})} `; function FocusedView(props: FocusViewProps) { const { @@ -103,9 +103,9 @@ function FocusedView(props: FocusViewProps) { const userOrganizations = main.organizations.length ? main.organizations.map((org: Organization) => ({ - label: toCapitalize(org.name), - value: org.uuid - })) + label: toCapitalize(org.name), + value: org.uuid + })) : []; function isNotHttps(url: string | undefined) { @@ -206,6 +206,7 @@ function FocusedView(props: FocusViewProps) { // eslint-disable-next-line @typescript-eslint/no-inferrable-types async function submitForm(body: any, shouldCloseModal: boolean = true) { let newBody = cloneDeep(body); + if (config && config.name === 'about') { const res = await main.saveProfile(newBody); if (shouldCloseModal) { @@ -226,9 +227,11 @@ function FocusedView(props: FocusViewProps) { if (!newBody.description) { addToast(); } + const info = ui.meInfo as any; if (!info) return console.log('no meInfo'); setLoading(true); + try { if (typeof newBody?.assignee !== 'string' || !newBody?.assignee) { newBody.assignee = newBody.assignee?.owner_pubkey ?? 'emptyid'; @@ -250,7 +253,9 @@ function FocusedView(props: FocusViewProps) { } catch (e) { console.log('e', e); } + if (props?.onSuccess) props.onSuccess(); + setLoading(false); if (ui?.meInfo?.hasOwnProperty('url') && !isNotHttps(ui?.meInfo?.url) && props?.ReCallBounties) props?.ReCallBounties(); @@ -380,8 +385,8 @@ function FocusedView(props: FocusViewProps) { extraHTML={ ui.meInfo.verification_signature ? { - twitter: `Post this to your twitter account to verify:
Sphinx Verification: ${ui.meInfo.verification_signature}` - } + twitter: `Post this to your twitter account to verify:
Sphinx Verification: ${ui.meInfo.verification_signature}` + } : {} } /> diff --git a/frontend/app/src/people/main/editUserModal/EditUserDesktopView.tsx b/frontend/app/src/people/main/editUserModal/EditUserDesktopView.tsx index b6bd99b86..95f14cb28 100644 --- a/frontend/app/src/people/main/editUserModal/EditUserDesktopView.tsx +++ b/frontend/app/src/people/main/editUserModal/EditUserDesktopView.tsx @@ -7,6 +7,7 @@ import { formConfig } from './config'; export const EditUserDesktopView = observer(() => { const { canEdit, closeHandler, person, modals } = useUserEdit(); + return (