From 86654e4a954a077622f8ac2ac7df337a9ca3e667 Mon Sep 17 00:00:00 2001 From: Sasi Date: Wed, 28 Dec 2022 18:27:52 +0530 Subject: [PATCH 1/3] fix: channel cover picture upload --- .../src/components/Channel/BasicInfo/index.tsx | 7 +++++-- apps/web/src/components/Settings/BasicInfo.tsx | 18 ++++++++---------- .../utils/functions/getChannelCoverPicture.ts | 11 +++++++++++ packages/utils/functions/getCoverPicture.ts | 14 -------------- 4 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 packages/utils/functions/getChannelCoverPicture.ts delete mode 100644 packages/utils/functions/getCoverPicture.ts diff --git a/apps/web/src/components/Channel/BasicInfo/index.tsx b/apps/web/src/components/Channel/BasicInfo/index.tsx index 228fe4113..7baa3ddbb 100644 --- a/apps/web/src/components/Channel/BasicInfo/index.tsx +++ b/apps/web/src/components/Channel/BasicInfo/index.tsx @@ -12,9 +12,10 @@ import type { FC } from 'react' import React, { useState } from 'react' import { FiSettings } from 'react-icons/fi' import { Analytics, TRACK } from 'utils' -import getCoverPicture from 'utils/functions/getCoverPicture' +import getChannelCoverPicture from 'utils/functions/getChannelCoverPicture' import getProfilePicture from 'utils/functions/getProfilePicture' import imageCdn from 'utils/functions/imageCdn' +import sanitizeIpfsUrl from 'utils/functions/sanitizeIpfsUrl' import MutualSubscribers from '../Mutual/MutualSubscribers' @@ -43,7 +44,9 @@ const BasicInfo: FC = ({ channel }) => {
diff --git a/apps/web/src/components/Settings/BasicInfo.tsx b/apps/web/src/components/Settings/BasicInfo.tsx index 9b699c9ad..0bc0da880 100644 --- a/apps/web/src/components/Settings/BasicInfo.tsx +++ b/apps/web/src/components/Settings/BasicInfo.tsx @@ -37,7 +37,7 @@ import { TRACK } from 'utils' import { VERIFIED_CHANNELS } from 'utils/data/verified' -import getCoverPicture from 'utils/functions/getCoverPicture' +import getChannelCoverPicture from 'utils/functions/getChannelCoverPicture' import { getValueFromKeyInAttributes } from 'utils/functions/getFromAttributes' import imageCdn from 'utils/functions/imageCdn' import omitKey from 'utils/functions/omitKey' @@ -85,7 +85,7 @@ const BasicInfo = ({ channel }: Props) => { const [copy] = useCopyToClipboard() const [loading, setLoading] = useState(false) const [uploading, setUploading] = useState(false) - const [coverImage, setCoverImage] = useState(getCoverPicture(channel)) + const [coverImage, setCoverImage] = useState(getChannelCoverPicture(channel)) const selectedChannel = useAppStore((state) => state.selectedChannel) const { @@ -197,6 +197,7 @@ const BasicInfo = ({ channel }: Props) => { } const onSaveBasicInfo = async (data: FormData) => { + console.log('🚀 ~ file: BasicInfo.tsx:200 ~ onSaveBasicInfo ~ data', data) Analytics.track(TRACK.UPDATE_CHANNEL_INFO) setLoading(true) try { @@ -269,16 +270,13 @@ const BasicInfo = ({ channel }: Props) => {
)} {`${channel.handle}