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]);
|
||||
|
||||
const onCancelPasteMode = useCallback(() => {
|
||||
cancelExecuteMacro();
|
||||
if (isPasteInProgress) {
|
||||
cancelExecuteMacro();
|
||||
}
|
||||
setDisableVideoFocusTrap(false);
|
||||
setInvalidChars([]);
|
||||
}, [setDisableVideoFocusTrap, cancelExecuteMacro]);
|
||||
}, [isPasteInProgress, setDisableVideoFocusTrap, cancelExecuteMacro]);
|
||||
|
||||
const onConfirmPaste = useCallback(async () => {
|
||||
if (!TextAreaRef.current || !selectedKeyboard) return;
|
||||
|
|
@ -226,7 +228,7 @@ export default function PasteModal() {
|
|||
<Button
|
||||
size="SM"
|
||||
theme="blank"
|
||||
text={m.cancel()}
|
||||
text={isPasteInProgress ? m.cancel() : m.close()}
|
||||
onClick={() => {
|
||||
onCancelPasteMode();
|
||||
close();
|
||||
|
|
|
|||
Loading…
Reference in New Issue