diff --git a/.deepsource.toml b/.deepsource.toml index 6c55c8ac0..836be8492 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -16,7 +16,3 @@ enabled = true [analyzers.meta] plugins = ["react"] - -[[transformers]] -name = "prettier" -enabled = true \ No newline at end of file diff --git a/apps/web/src/components/Bangers/New.tsx b/apps/web/src/components/Bangers/New.tsx index 10c7e997a..8ada72829 100644 --- a/apps/web/src/components/Bangers/New.tsx +++ b/apps/web/src/components/Bangers/New.tsx @@ -187,9 +187,8 @@ const New: FC = ({ refetch }) => { if (!activeProfile) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setLoading(true) const linkText = trimify(getValues('link')) const attributes: MetadataAttribute[] = [ diff --git a/apps/web/src/components/Common/GlobalDialogs/SwitchNetworkDialog.tsx b/apps/web/src/components/Common/GlobalDialogs/SwitchNetworkDialog.tsx deleted file mode 100644 index 5f3ee2852..000000000 --- a/apps/web/src/components/Common/GlobalDialogs/SwitchNetworkDialog.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import useNetworkStore from '@lib/store/network' -import { POLYGON_CHAIN_ID } from '@tape.xyz/constants' -import { Button, Modal } from '@tape.xyz/ui' -import React from 'react' -import { useSwitchChain } from 'wagmi' - -const SwitchNetworkDialog = () => { - const { showSwitchNetwork, setShowSwitchNetwork } = useNetworkStore() - const { switchChainAsync } = useSwitchChain() - - if (!showSwitchNetwork) { - return null - } - - return ( - -
- -
-
- ) -} - -export default SwitchNetworkDialog diff --git a/apps/web/src/components/Common/GlobalDialogs/index.tsx b/apps/web/src/components/Common/GlobalDialogs/index.tsx deleted file mode 100644 index c44a58150..000000000 --- a/apps/web/src/components/Common/GlobalDialogs/index.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import SwitchNetworkDialog from './SwitchNetworkDialog' - -const GlobalDialogs = () => { - return -} - -export default GlobalDialogs diff --git a/apps/web/src/components/Common/MirrorPublication.tsx b/apps/web/src/components/Common/MirrorPublication.tsx index b2c533955..a2c2d499d 100644 --- a/apps/web/src/components/Common/MirrorPublication.tsx +++ b/apps/web/src/components/Common/MirrorPublication.tsx @@ -187,9 +187,7 @@ const MirrorPublication: FC = ({ if (!activeProfile?.id) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() if (video.momoka?.proof && !activeProfile?.sponsor) { return toast.error( diff --git a/apps/web/src/components/Common/Providers/index.tsx b/apps/web/src/components/Common/Providers/index.tsx index db1de3af0..927710abe 100644 --- a/apps/web/src/components/Common/Providers/index.tsx +++ b/apps/web/src/components/Common/Providers/index.tsx @@ -13,7 +13,6 @@ import ThemeProvider from './ThemeProvider' const SubscriptionProvider = dynamic(() => import('./SubscriptionProvider')) const TogglesProvider = dynamic(() => import('./TogglesProvider')) const Web3Provider = dynamic(() => import('./Web3Provider')) -const GlobalDialogs = dynamic(() => import('../GlobalDialogs')) const Layout = dynamic(() => import('../Layout')) const NO_TOP_NAV_PATHS = ['/login'] @@ -47,7 +46,6 @@ const Providers = ({ children }: { children: ReactNode }) => { - = ({ publication, children }) => { setShowConfirm(false) } - const onClickReport = () => { + const onClickReport = async () => { if (!activeProfile?.id) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setShowReportModal(true) } @@ -206,9 +205,7 @@ const PublicationOptions: FC = ({ publication, children }) => { if (!activeProfile) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() try { toast.loading(`Pinning video...`) @@ -395,7 +392,6 @@ const PublicationOptions: FC = ({ publication, children }) => { e.preventDefault() setShowShareModal(true) }} - className="flex items-center justify-start space-x-2 rounded-md px-3 py-1.5 hover:bg-gray-500/20" >
@@ -469,7 +465,6 @@ const PublicationOptions: FC = ({ publication, children }) => { /> { e.preventDefault() onClickReport() diff --git a/apps/web/src/components/Create/DropZone.tsx b/apps/web/src/components/Create/DropZone.tsx index 56f24faf4..f3c7ebbbe 100644 --- a/apps/web/src/components/Create/DropZone.tsx +++ b/apps/web/src/components/Create/DropZone.tsx @@ -1,3 +1,4 @@ +import useHandleWrongNetwork from '@hooks/useHandleWrongNetwork' import useAppStore from '@lib/store' import useProfileStore from '@lib/store/idb/profile' import { tw, useDragAndDrop } from '@tape.xyz/browser' @@ -15,6 +16,7 @@ import toast from 'react-hot-toast' const DropZone = () => { const setUploadedMedia = useAppStore((state) => state.setUploadedMedia) const activeProfile = useProfileStore((state) => state.activeProfile) + const handleWrongNetwork = useHandleWrongNetwork() const { setDragOver, @@ -24,7 +26,9 @@ const DropZone = () => { setFileDropError } = useDragAndDrop() - const handleUploadedMedia = (file: File) => { + const handleUploadedMedia = async (file: File) => { + await handleWrongNetwork() + try { if (file) { const preview = URL.createObjectURL(file) diff --git a/apps/web/src/components/Create/index.tsx b/apps/web/src/components/Create/index.tsx index 9b463e141..1a807a154 100644 --- a/apps/web/src/components/Create/index.tsx +++ b/apps/web/src/components/Create/index.tsx @@ -1,5 +1,4 @@ import MetaTags from '@components/Common/MetaTags' -import useHandleWrongNetwork from '@hooks/useHandleWrongNetwork' import type { AudioOptions, MediaAudioMimeType, @@ -90,7 +89,6 @@ const CreateSteps = () => { const router = useRouter() const { data: walletClient } = useWalletClient() - const handleWrongNetwork = useHandleWrongNetwork() const { canUseLensManager, canBroadcast } = checkLensManagerPermissions(activeProfile) @@ -143,12 +141,6 @@ const CreateSteps = () => { Tower.track(EVENTS.PAGEVIEW, { page: EVENTS.PAGE_VIEW.UPLOAD }) }, []) - useEffect(() => { - if (handleWrongNetwork()) { - return - } - }, [handleWrongNetwork]) - const stopLoading = () => { setUploadedMedia({ buttonText: 'Post Now', diff --git a/apps/web/src/components/Login/Authenticate.tsx b/apps/web/src/components/Login/Authenticate.tsx index 408304aa7..ceba8766a 100644 --- a/apps/web/src/components/Login/Authenticate.tsx +++ b/apps/web/src/components/Login/Authenticate.tsx @@ -1,12 +1,13 @@ import ButtonShimmer from '@components/Shimmers/ButtonShimmer' import { signIn, signOut } from '@lib/store/auth' import useProfileStore from '@lib/store/idb/profile' -import { ERROR_MESSAGE } from '@tape.xyz/constants' +import { ERROR_MESSAGE, IS_MAINNET } from '@tape.xyz/constants' import { EVENTS, getProfile, getProfilePicture, logger, + shortenAddress, Tower } from '@tape.xyz/generic' import type { Profile } from '@tape.xyz/lens' @@ -17,7 +18,13 @@ import { useProfilesManagedQuery } from '@tape.xyz/lens' import { useApolloClient } from '@tape.xyz/lens/apollo' -import { Button, Select, SelectItem } from '@tape.xyz/ui' +import { + Button, + Callout, + Select, + SelectItem, + WarningOutline +} from '@tape.xyz/ui' import { useRouter } from 'next/router' import React, { memo, useCallback, useMemo, useState } from 'react' import toast from 'react-hot-toast' @@ -31,6 +38,7 @@ const Authenticate = () => { } = useRouter() const [loading, setLoading] = useState(false) + const [showSignup, setShowSignup] = useState(false) const [selectedProfileId, setSelectedProfileId] = useState('') const { activeProfile, setActiveProfile } = useProfileStore() @@ -55,8 +63,11 @@ const Authenticate = () => { onCompleted: (data) => { const profiles = data?.profilesManaged.items if (profiles?.length) { + setShowSignup(false) const profile = [...profiles].reverse()[0] setSelectedProfileId(as || profile.id) + } else { + setShowSignup(true) } } }) @@ -164,39 +175,71 @@ const Authenticate = () => { } return ( -
- {profile ? ( +
+ {!IS_MAINNET && showSignup ? ( + refetch()} + setShowSignup={setShowSignup} + showLogin={Boolean(profile)} + /> + ) : (
- - + {profile ? ( + <> + + + + ) : ( + } + > + We couldn't find any profiles linked to the connected address. ( + {shortenAddress(address as string)}) + + )} + {!IS_MAINNET && ( +
+ {profile ? ( + Need new account? + ) : ( + Don't have an account? + )} + +
+ )}
- ) : ( - refetch()} /> )}
) diff --git a/apps/web/src/components/Login/Connectors.tsx b/apps/web/src/components/Login/Connectors.tsx index 43bc40a93..6cd72adca 100644 --- a/apps/web/src/components/Login/Connectors.tsx +++ b/apps/web/src/components/Login/Connectors.tsx @@ -1,4 +1,6 @@ +import useHandleWrongNetwork from '@hooks/useHandleWrongNetwork' import useProfileStore from '@lib/store/idb/profile' +import { EVENTS, Tower } from '@tape.xyz/generic' import { Button, Callout, CheckOutline, WarningOutline } from '@tape.xyz/ui' import React, { memo, useMemo } from 'react' import type { Connector } from 'wagmi' @@ -10,11 +12,14 @@ const Connectors = () => { const { activeProfile } = useProfileStore() const { connector: connected } = useAccount() + const handleWrongNetwork = useHandleWrongNetwork() const { connectors, connectAsync, isPending, error } = useConnect() const onChooseConnector = async (connector: Connector) => { try { + await handleWrongNetwork() await connectAsync({ connector }) + Tower.track(EVENTS.AUTH.CONNECT_WALLET, { connector: connector.id }) } catch {} } diff --git a/apps/web/src/components/Login/Signup.tsx b/apps/web/src/components/Login/Signup.tsx index 6194e85c2..1d2519a6d 100644 --- a/apps/web/src/components/Login/Signup.tsx +++ b/apps/web/src/components/Login/Signup.tsx @@ -1,19 +1,34 @@ import { zodResolver } from '@hookform/resolvers/zod' +import useHandleWrongNetwork from '@hooks/useHandleWrongNetwork' import usePendingTxn from '@hooks/usePendingTxn' +import { TAPE_SIGNUP_PROXY_ABI } from '@tape.xyz/abis' +import { useDebounce } from '@tape.xyz/browser' import { COMMON_REGEX, ERROR_MESSAGE, - IS_MAINNET, - LENS_NAMESPACE_PREFIX + LENS_NAMESPACE_PREFIX, + TAPE_SIGNUP_PRICE, + TAPE_SIGNUP_PROXY_ADDRESS, + ZERO_ADDRESS } from '@tape.xyz/constants' -import { shortenAddress } from '@tape.xyz/generic' -import { useCreateProfileWithHandleMutation } from '@tape.xyz/lens' +import { + useGenerateLensApiRelayAddressLazyQuery, + useProfileLazyQuery +} from '@tape.xyz/lens' import type { CustomErrorWithData } from '@tape.xyz/lens/custom-types' -import { Button, Callout, Input, WarningOutline } from '@tape.xyz/ui' +import { + Button, + CheckOutline, + Input, + Spinner, + TimesOutline, + Tooltip +} from '@tape.xyz/ui' import React, { useEffect, useState } from 'react' import { useForm } from 'react-hook-form' import toast from 'react-hot-toast' -import { useAccount } from 'wagmi' +import { parseEther } from 'viem' +import { useAccount, useWriteContract } from 'wagmi' import type { z } from 'zod' import { object, string } from 'zod' @@ -27,43 +42,70 @@ const formSchema = object({ }) type FormData = z.infer -const Signup = ({ onSuccess }: { onSuccess: () => void }) => { +const Signup = ({ + showLogin, + onSuccess, + setShowSignup +}: { + showLogin: boolean + onSuccess: () => void + setShowSignup: (b: boolean) => void +}) => { const { register, - formState: { errors }, + formState: { errors, isValid }, handleSubmit, - reset + reset, + watch } = useForm({ resolver: zodResolver(formSchema) }) const [creating, setCreating] = useState(false) + const [isHandleAvailable, setIsHandleAvailable] = useState(false) + const handleWrongNetwork = useHandleWrongNetwork() + const { address } = useAccount() + const handle = watch('handle') + const debouncedValue = useDebounce(handle, 500) + + const [generateRelayerAddress] = useGenerateLensApiRelayAddressLazyQuery({ + fetchPolicy: 'no-cache' + }) + const [checkAvailability, { loading: checkingAvailability }] = + useProfileLazyQuery() const onError = (error: CustomErrorWithData) => { setCreating(false) toast.error(error?.data?.message ?? error?.message ?? ERROR_MESSAGE) } - const [createProfileWithHandle, { data }] = - useCreateProfileWithHandleMutation({ - onError, - onCompleted: ({ createProfileWithHandle }) => { - if ( - createProfileWithHandle.__typename === - 'CreateProfileWithHandleErrorResult' - ) { - setCreating(false) - toast.error(createProfileWithHandle.reason) + const { writeContractAsync, data: txnHash } = useWriteContract({ + mutation: { + onError + } + }) + + const onSearchDebounce = async () => { + if (handle?.trim().length) { + const { data } = await checkAvailability({ + variables: { + request: { + forHandle: `${LENS_NAMESPACE_PREFIX}${handle}` + } } + }) + if (data?.profile) { + return setIsHandleAvailable(false) } - }) + setIsHandleAvailable(true) + } + } const { indexed, error } = usePendingTxn({ - txId: - data?.createProfileWithHandle.__typename === 'RelaySuccess' - ? data?.createProfileWithHandle?.txId - : undefined + ...(txnHash && { + txHash: txnHash + }) }) useEffect(() => { @@ -72,39 +114,91 @@ const Signup = ({ onSuccess }: { onSuccess: () => void }) => { reset() toast.success('Profile created') setCreating(false) - location.reload() } // eslint-disable-next-line react-hooks/exhaustive-deps }, [indexed, error]) + useEffect(() => { + onSearchDebounce() + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [debouncedValue]) + const signup = async ({ handle }: FormData) => { + await handleWrongNetwork() + setCreating(true) - await createProfileWithHandle({ - variables: { request: { handle: handle.toLowerCase(), to: address } } - }) + try { + const { data } = await generateRelayerAddress() + const relayerAddress = data?.generateLensAPIRelayAddress + if (!relayerAddress) { + setCreating(false) + return toast.error(ERROR_MESSAGE) + } + return await writeContractAsync({ + abi: TAPE_SIGNUP_PROXY_ABI, + address: TAPE_SIGNUP_PROXY_ADDRESS, + args: [[address, ZERO_ADDRESS, '0x'], handle, [relayerAddress]], + functionName: 'createProfileWithHandleUsingCredits', + value: parseEther(TAPE_SIGNUP_PRICE) + }) + } catch {} } return ( -
- }> - We couldn't find any profiles linked to the connected address. ( - {shortenAddress(address as string)}) - - {!IS_MAINNET && ( -
- - -
+
+
+ + {isValid && ( +
+ {checkingAvailability ? ( + + + + ) : ( + + {isHandleAvailable ? ( + + + + ) : ( + + + + )} + + )} +
+ )} +
+ + {showLogin && ( +
+ Have an account? + +
)} -
+ ) } diff --git a/apps/web/src/components/Profile/BasicInfo/Follow.tsx b/apps/web/src/components/Profile/BasicInfo/Follow.tsx index e6bf98f1f..c921943d4 100644 --- a/apps/web/src/components/Profile/BasicInfo/Follow.tsx +++ b/apps/web/src/components/Profile/BasicInfo/Follow.tsx @@ -144,9 +144,7 @@ const Follow: FC = ({ profile, onSubscribe }) => { if (!activeProfile?.id) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() setLoading(true) const request = { diff --git a/apps/web/src/components/Profile/BasicInfo/UnFollow.tsx b/apps/web/src/components/Profile/BasicInfo/UnFollow.tsx index 27a2fb21d..f555f4e7d 100644 --- a/apps/web/src/components/Profile/BasicInfo/UnFollow.tsx +++ b/apps/web/src/components/Profile/BasicInfo/UnFollow.tsx @@ -122,9 +122,7 @@ const UnFollow: FC = ({ profile, onUnSubscribe }) => { if (!activeProfile?.id) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() setLoading(true) if (canUseLensManager) { diff --git a/apps/web/src/components/Profile/BasicInfo/index.tsx b/apps/web/src/components/Profile/BasicInfo/index.tsx index 6bccf3b54..6a20ddae1 100644 --- a/apps/web/src/components/Profile/BasicInfo/index.tsx +++ b/apps/web/src/components/Profile/BasicInfo/index.tsx @@ -333,7 +333,6 @@ const BasicInfo: FC = ({ profile }) => { e.preventDefault() setShowReportModal(true) }} - className="rounded-md px-3 py-1.5 hover:bg-gray-500/20" >
diff --git a/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx b/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx index 18b41ad59..dfa2ea2f8 100644 --- a/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx +++ b/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx @@ -154,9 +154,7 @@ const PinnedVideo: FC = ({ id }) => { if (!activeProfile) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() try { toast.loading(`Unpinning video...`) diff --git a/apps/web/src/components/Settings/BasicInfo.tsx b/apps/web/src/components/Settings/BasicInfo.tsx index c9e4f0aab..7496a8faa 100644 --- a/apps/web/src/components/Settings/BasicInfo.tsx +++ b/apps/web/src/components/Settings/BasicInfo.tsx @@ -209,9 +209,8 @@ const BasicInfo = ({ profile }: Props) => { })) ?? [] const onSaveBasicInfo = async (data: FormData) => { - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + try { setLoading(true) const metadata: ProfileOptions = { diff --git a/apps/web/src/components/Settings/Blocked/List.tsx b/apps/web/src/components/Settings/Blocked/List.tsx index 929807b0c..02d752bc1 100644 --- a/apps/web/src/components/Settings/Blocked/List.tsx +++ b/apps/web/src/components/Settings/Blocked/List.tsx @@ -186,9 +186,7 @@ const List = () => { if (!activeProfile?.id) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() try { setUnblockingProfileId(profileId) diff --git a/apps/web/src/components/Settings/DangerZone/Delete.tsx b/apps/web/src/components/Settings/DangerZone/Delete.tsx index e1b814892..563f5755d 100644 --- a/apps/web/src/components/Settings/DangerZone/Delete.tsx +++ b/apps/web/src/components/Settings/DangerZone/Delete.tsx @@ -58,13 +58,12 @@ const Delete = () => { return new Date(cooldownDate).getTime() < Date.now() } - const onClickDelete = () => { + const onClickDelete = async () => { if (guardianEnabled || !isCooldownEnded()) { return toast.error('Profile Guardian enabled') } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setLoading(true) try { toast.loading(REQUESTING_SIGNATURE_MESSAGE) diff --git a/apps/web/src/components/Settings/DangerZone/Guardian.tsx b/apps/web/src/components/Settings/DangerZone/Guardian.tsx index 2be475766..dc49863b5 100644 --- a/apps/web/src/components/Settings/DangerZone/Guardian.tsx +++ b/apps/web/src/components/Settings/DangerZone/Guardian.tsx @@ -72,9 +72,7 @@ const Guardian: FC = () => { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() try { setLoading(true) diff --git a/apps/web/src/components/Settings/Follow/FeeFollow.tsx b/apps/web/src/components/Settings/Follow/FeeFollow.tsx index 921e7ee5a..919755796 100644 --- a/apps/web/src/components/Settings/Follow/FeeFollow.tsx +++ b/apps/web/src/components/Settings/Follow/FeeFollow.tsx @@ -177,9 +177,8 @@ const FeeFollow = ({ profile }: Props) => { }) const updateFeeFollow = async (disable: boolean) => { - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setLoading(true) return await createSetFollowModuleTypedData({ variables: { diff --git a/apps/web/src/components/Settings/Follow/RevertFollow.tsx b/apps/web/src/components/Settings/Follow/RevertFollow.tsx index f0bbeb180..b67532645 100644 --- a/apps/web/src/components/Settings/Follow/RevertFollow.tsx +++ b/apps/web/src/components/Settings/Follow/RevertFollow.tsx @@ -130,9 +130,8 @@ const RevertFollow = ({ profile }: Props) => { }) const toggleRevert = async (revertFollowModule: boolean) => { - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setLoading(true) return await createSetFollowModuleTypedData({ variables: { diff --git a/apps/web/src/components/Settings/Manager/LensManager/ToggleLensManager.tsx b/apps/web/src/components/Settings/Manager/LensManager/ToggleLensManager.tsx index 655a3267d..57b629f27 100644 --- a/apps/web/src/components/Settings/Manager/LensManager/ToggleLensManager.tsx +++ b/apps/web/src/components/Settings/Manager/LensManager/ToggleLensManager.tsx @@ -127,10 +127,9 @@ const ToggleLensManager = () => { onError }) - const onClick = () => { - if (handleWrongNetwork()) { - return - } + const onClick = async () => { + await handleWrongNetwork() + setLoading(true) return toggleLensManager({ variables: { diff --git a/apps/web/src/components/Settings/Manager/Managers.tsx b/apps/web/src/components/Settings/Manager/Managers.tsx index cc4d8b06d..4862fffec 100644 --- a/apps/web/src/components/Settings/Manager/Managers.tsx +++ b/apps/web/src/components/Settings/Manager/Managers.tsx @@ -212,9 +212,8 @@ const Managers = () => { }) const addManager = async ({ address }: FormData) => { - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setSubmitting(true) return await toggleLensManager({ variables: { @@ -232,9 +231,8 @@ const Managers = () => { } const removeManager = async (address: string) => { - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setRemovingAddress(address) return await toggleLensManager({ variables: { diff --git a/apps/web/src/components/Watch/Comments/CommentOptions.tsx b/apps/web/src/components/Watch/Comments/CommentOptions.tsx index 80f428cac..57e656caa 100644 --- a/apps/web/src/components/Watch/Comments/CommentOptions.tsx +++ b/apps/web/src/components/Watch/Comments/CommentOptions.tsx @@ -51,13 +51,12 @@ const CommentOptions: FC = ({ comment }) => { setShowConfirm(false) } - const onClickReport = () => { + const onClickReport = async () => { if (!activeProfile?.id) { return toast.error(SIGN_IN_REQUIRED) } - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setShowReportModal(true) } diff --git a/apps/web/src/components/Watch/Comments/NewComment.tsx b/apps/web/src/components/Watch/Comments/NewComment.tsx index 9a49464fe..a9950f077 100644 --- a/apps/web/src/components/Watch/Comments/NewComment.tsx +++ b/apps/web/src/components/Watch/Comments/NewComment.tsx @@ -297,9 +297,8 @@ const NewComment: FC = ({ ) } try { - if (handleWrongNetwork()) { - return - } + await handleWrongNetwork() + setLoading(true) const attributes: MetadataAttribute[] = [ { diff --git a/apps/web/src/components/Watch/Comments/RenderComment.tsx b/apps/web/src/components/Watch/Comments/RenderComment.tsx index 41c67b2e1..e71324620 100644 --- a/apps/web/src/components/Watch/Comments/RenderComment.tsx +++ b/apps/web/src/components/Watch/Comments/RenderComment.tsx @@ -130,13 +130,11 @@ const RenderComment: FC = ({ comment }) => {