Skip to content

Commit

Permalink
Fix wrong var used
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Nov 28, 2023
1 parent 9f8f7e7 commit 880980c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/components/auth/LoginModal/LoginModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import { ModalFunctionalityProps } from '@/components/modals/Modal'
import ProfilePreview from '@/components/ProfilePreview'
import Toast from '@/components/Toast'
import useLoginAndRequestToken from '@/hooks/useLoginAndRequestToken'
import useLoginOptions from '@/hooks/useLoginOptions'
import useSignMessageAndLinkEvmAddress from '@/hooks/useSignMessageAndLinkEvmAddress'
import useToastError from '@/hooks/useToastError'
import useWithoutAnonLoginOptions from '@/hooks/useWithoutAnonLoginOptions'
import { ApiRequestTokenResponse } from '@/pages/api/request-token'
import { useRequestToken } from '@/services/api/mutation'
import { useSendEvent } from '@/stores/analytics'
Expand Down Expand Up @@ -71,7 +71,7 @@ export const LoginContent = ({
}: ContentProps) => {
const [hasStartCaptcha, setHasStartCaptcha] = useState(false)
const sendEvent = useSendEvent()
const { withoutAnonLoginOptions } = useWithoutAnonLoginOptions()
const { isNonAnonLoginRequired } = useLoginOptions()

const {
mutateAsync: loginAndRequestToken,
Expand All @@ -93,7 +93,7 @@ export const LoginContent = ({
<div
className={cx(
'flex flex-col gap-4',
withoutAnonLoginOptions && 'pb-4'
isNonAnonLoginRequired && 'pb-4'
)}
>
<Button
Expand All @@ -118,7 +118,7 @@ export const LoginContent = ({
Enter Grill secret key
</div>
</Button>
{!withoutAnonLoginOptions && (
{!isNonAnonLoginRequired && (
<>
<Button
type='button'
Expand Down
6 changes: 3 additions & 3 deletions src/components/chats/ChatForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import TextArea, { TextAreaProps } from '@/components/inputs/TextArea'
import EmailSubscribeModal from '@/components/modals/EmailSubscribeModal'
import { ERRORS } from '@/constants/error'
import useAutofocus from '@/hooks/useAutofocus'
import useLoginOptions from '@/hooks/useLoginOptions'
import useRequestTokenAndSendMessage from '@/hooks/useRequestTokenAndSendMessage'
import { showErrorToast } from '@/hooks/useToastError'
import useWithoutAnonLoginOptions from '@/hooks/useWithoutAnonLoginOptions'
import { useConfigContext } from '@/providers/ConfigProvider'
import { getPostQuery } from '@/services/api/query'
import {
Expand Down Expand Up @@ -92,7 +92,7 @@ export default function ChatForm({
const messageToEdit = useMessageData((state) => state.messageToEdit)
const clearAction = useMessageData((state) => state.clearAction)
const setMessageBody = useMessageData((state) => state.setMessageBody)
const { withoutAnonLoginOptions } = useWithoutAnonLoginOptions()
const { isNonAnonLoginRequired } = useLoginOptions()

const { data: editedMessage } = getPostQuery.useQuery(messageToEdit, {
enabled: !!messageToEdit,
Expand Down Expand Up @@ -225,7 +225,7 @@ export default function ChatForm({
return
}

const willOpenLoginModal = withoutAnonLoginOptions && !isLoggedIn
const willOpenLoginModal = isNonAnonLoginRequired && !isLoggedIn
if (!hasSentMessageStorage.get() && !willOpenLoginModal) {
setTimeout(() => {
setIsOpenCtaModal(true)
Expand Down

0 comments on commit 880980c

Please sign in to comment.