Prevent executing _onCopy() when text is selected on receive text dialog
This commit is contained in:
parent
676c68b6e7
commit
d58f380565
|
@ -1978,12 +1978,15 @@ class ReceiveTextDialog extends Dialog {
|
||||||
this._receiveTextQueue = [];
|
this._receiveTextQueue = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectionEmpty() {
|
||||||
|
return !window.getSelection().toString()
|
||||||
|
}
|
||||||
|
|
||||||
async _onKeyDown(e) {
|
async _onKeyDown(e) {
|
||||||
if (!this.isShown()) return
|
if (!this.isShown()) return
|
||||||
|
|
||||||
if (e.code === "KeyC" && (e.ctrlKey || e.metaKey)) {
|
if (e.code === "KeyC" && (e.ctrlKey || e.metaKey) && this.selectionEmpty()) {
|
||||||
await this._onCopy()
|
await this._onCopy()
|
||||||
this.hide();
|
|
||||||
}
|
}
|
||||||
else if (e.code === "Escape") {
|
else if (e.code === "Escape") {
|
||||||
this.hide();
|
this.hide();
|
||||||
|
|
Loading…
Reference in New Issue