Disable emoji and sticker pickers if conversation has open panels
This commit is contained in:
parent
01bf53776b
commit
0512d08d61
2 changed files with 12 additions and 0 deletions
|
@ -88,6 +88,12 @@ export const EmojiButton = React.memo(
|
||||||
const { ctrlKey, key, metaKey, shiftKey } = event;
|
const { ctrlKey, key, metaKey, shiftKey } = event;
|
||||||
const ctrlOrCommand = metaKey || ctrlKey;
|
const ctrlOrCommand = metaKey || ctrlKey;
|
||||||
|
|
||||||
|
// We don't want to open up if the conversation has any panels open
|
||||||
|
const panels = document.querySelectorAll('.conversation .panel');
|
||||||
|
if (panels && panels.length > 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctrlOrCommand && shiftKey && (key === 'e' || key === 'E')) {
|
if (ctrlOrCommand && shiftKey && (key === 'e' || key === 'E')) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
@ -154,6 +154,12 @@ export const StickerButton = React.memo(
|
||||||
const { ctrlKey, key, metaKey, shiftKey } = event;
|
const { ctrlKey, key, metaKey, shiftKey } = event;
|
||||||
const ctrlOrCommand = metaKey || ctrlKey;
|
const ctrlOrCommand = metaKey || ctrlKey;
|
||||||
|
|
||||||
|
// We don't want to open up if the conversation has any panels open
|
||||||
|
const panels = document.querySelectorAll('.conversation .panel');
|
||||||
|
if (panels && panels.length > 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctrlOrCommand && shiftKey && (key === 's' || key === 'S')) {
|
if (ctrlOrCommand && shiftKey && (key === 's' || key === 'S')) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue