fix: Sending by pressing enter in chat doesn't work
This commit is contained in:
parent
b87dd3dee1
commit
48c3ff8112
|
@ -100,9 +100,9 @@ function onDragover(ev: DragEvent) {
|
||||||
switch (ev.dataTransfer.effectAllowed) {
|
switch (ev.dataTransfer.effectAllowed) {
|
||||||
case 'all':
|
case 'all':
|
||||||
case 'uninitialized':
|
case 'uninitialized':
|
||||||
case 'copy':
|
case 'copy':
|
||||||
case 'copyLink':
|
case 'copyLink':
|
||||||
case 'copyMove':
|
case 'copyMove':
|
||||||
ev.dataTransfer.dropEffect = 'copy';
|
ev.dataTransfer.dropEffect = 'copy';
|
||||||
break;
|
break;
|
||||||
case 'linkMove':
|
case 'linkMove':
|
||||||
|
@ -144,8 +144,14 @@ function onDrop(ev: DragEvent): void {
|
||||||
|
|
||||||
function onKeydown(ev: KeyboardEvent) {
|
function onKeydown(ev: KeyboardEvent) {
|
||||||
typing();
|
typing();
|
||||||
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) {
|
if (defaultStore.state.useEnterToSend && !ev.shiftKey) {
|
||||||
send();
|
if ((ev.key === 'Enter') && canSend) {
|
||||||
|
send();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) {
|
||||||
|
send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue