Skip to content

Commit

Permalink
Merge pull request #417 from dappforce/fix/edit-profile-save-content
Browse files Browse the repository at this point in the history
Fix edit profile save content
  • Loading branch information
olehmell authored May 13, 2024
2 parents 61b44fb + cc85bf3 commit 4bd8547
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/spaces/EditSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ export function InnerForm(props: FormProps) {
const fieldValuesToContent = (): Content => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { whoCanPost, ...spaceContent } = getFieldValues()
return getNonEmptySpaceContent(spaceContent as Content)

const content = { ...(space?.content || {}), ...spaceContent }

return getNonEmptySpaceContent(content as Content)
}

const pinToIpfsAndBuildTxParams = () =>
Expand Down
4 changes: 3 additions & 1 deletion src/components/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export const getInstallUrl = (instalUrls: string) => {
}

export function getCreatorChatIdFromProfile(profile?: SpaceData | null) {
const chats = (profile?.content as any)?.experimental?.chats || (profile?.content as any)?.chats
const content = profile?.content as any

const chats =
content?.experimental?.chats || content?.chats || content?.experimental?.experimental?.chats
return chats?.[0]?.id as string | undefined
}

0 comments on commit 4bd8547

Please sign in to comment.