mirror of https://github.com/jetkvm/kvm.git
Change label of cancel button to close if no macro running.
This commit is contained in:
parent
a9a436cadc
commit
e89491a513
|
|
@ -54,10 +54,12 @@ export default function PasteModal() {
|
||||||
}, [send, setKeyboardLayout]);
|
}, [send, setKeyboardLayout]);
|
||||||
|
|
||||||
const onCancelPasteMode = useCallback(() => {
|
const onCancelPasteMode = useCallback(() => {
|
||||||
cancelExecuteMacro();
|
if (isPasteInProgress) {
|
||||||
|
cancelExecuteMacro();
|
||||||
|
}
|
||||||
setDisableVideoFocusTrap(false);
|
setDisableVideoFocusTrap(false);
|
||||||
setInvalidChars([]);
|
setInvalidChars([]);
|
||||||
}, [setDisableVideoFocusTrap, cancelExecuteMacro]);
|
}, [isPasteInProgress, setDisableVideoFocusTrap, cancelExecuteMacro]);
|
||||||
|
|
||||||
const onConfirmPaste = useCallback(async () => {
|
const onConfirmPaste = useCallback(async () => {
|
||||||
if (!TextAreaRef.current || !selectedKeyboard) return;
|
if (!TextAreaRef.current || !selectedKeyboard) return;
|
||||||
|
|
@ -226,7 +228,7 @@ export default function PasteModal() {
|
||||||
<Button
|
<Button
|
||||||
size="SM"
|
size="SM"
|
||||||
theme="blank"
|
theme="blank"
|
||||||
text={m.cancel()}
|
text={isPasteInProgress ? m.cancel() : m.close()}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onCancelPasteMode();
|
onCancelPasteMode();
|
||||||
close();
|
close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue