Skip to content

Commit

Permalink
fix(messenger): textInput disable logic
Browse files Browse the repository at this point in the history
Signed-off-by: clegirar <clemntgirard@gmail.com>
  • Loading branch information
clegirar committed Oct 10, 2020
1 parent c0566c6 commit c55fcbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/packages/components/chat/OneToOne.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ export const OneToOne: React.FC<ScreenProps.Chat.OneToOne> = ({ route: { params
null
const isIncoming = contact.state === messengerpb.Contact.State.IncomingRequest
const persistOpts = usePersistentOptions()
const isBetabot =
persistOpts && conv?.contactPublicKey?.toString() === persistOpts?.betabot?.convPk?.toString()
const isBetabotAdded = persistOpts && persistOpts.betabot.added

return (
Expand All @@ -710,7 +712,7 @@ export const OneToOne: React.FC<ScreenProps.Chat.OneToOne> = ({ route: { params
convPk={params?.convId}
isFocused={inputIsFocused}
setFocus={setInputFocus}
disabled={isIncoming || (isBetabotAdded ? false : true)}
disabled={isIncoming || (isBetabot && !isBetabotAdded)}
/>
<ChatHeader convPk={params?.convId || ''} />
</KeyboardAvoidingView>
Expand Down

0 comments on commit c55fcbd

Please sign in to comment.