Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
conversation control tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
eramdam committed Jul 29, 2021
1 parent 503417b commit 9a191bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/components/conversationControlsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export const ConversationControlsButton: FC<{
const accountKey = data.request.accountKey;
const tweetId = data.response.id_str;
const client = getClient(accountKey);
const isReplyingToATweet = Boolean(data.response.in_reply_to_status_id_str);

if (!client || conversationMode === TwitterConversationModes.EVERYONE) {
if (!client || conversationMode === TwitterConversationModes.EVERYONE || isReplyingToATweet) {
return;
}

Expand Down Expand Up @@ -83,6 +84,11 @@ export const ConversationControlsButton: FC<{
.-gif-hidden & {
left: 13px;
}
.js-in-reply-to:not(.is-hidden) ~ .compose-text-container &,
.js-compose-message-recipient-container:not(.is-hidden) ~ .compose-text-container & {
display: none !important;
}
`,
'js-show-tip'
)}
Expand Down
16 changes: 10 additions & 6 deletions src/features/conversationControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ export const addConversationControls = makeBTDModule(({TD, jq, mR, settings}) =>
unmountComponentAtNode(root);
}

onComposerShown((isVisible) => {
if (!isVisible) {
unmount();
return;
}

function mount() {
root = document.createElement('div');
root.id = 'btdConversationControl';
if (!settings.showGifPicker) {
Expand All @@ -88,5 +83,14 @@ export const addConversationControls = makeBTDModule(({TD, jq, mR, settings}) =>
/>,
root
);
}

onComposerShown((isVisible) => {
if (!isVisible) {
unmount();
return;
}

mount();
});
});

0 comments on commit 9a191bc

Please sign in to comment.