fix: Sending by pressing enter in chat doesn't work

This commit is contained in:
NoriDev 2023-05-18 16:47:27 +09:00
parent b87dd3dee1
commit 48c3ff8112

View file

@ -100,9 +100,9 @@ function onDragover(ev: DragEvent) {
switch (ev.dataTransfer.effectAllowed) {
case 'all':
case 'uninitialized':
case 'copy':
case 'copyLink':
case 'copyMove':
case 'copy':
case 'copyLink':
case 'copyMove':
ev.dataTransfer.dropEffect = 'copy';
break;
case 'linkMove':
@ -144,8 +144,14 @@ function onDrop(ev: DragEvent): void {
function onKeydown(ev: KeyboardEvent) {
typing();
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) {
send();
if (defaultStore.state.useEnterToSend && !ev.shiftKey) {
if ((ev.key === 'Enter') && canSend) {
send();
}
} else {
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) {
send();
}
}
}