fix(tui): handle 4-5 codes too in c to copy logic
This commit is contained in:
@@ -127,7 +127,7 @@ function AutoMethod(props: AutoMethodProps) {
|
|||||||
|
|
||||||
useKeyboard((evt) => {
|
useKeyboard((evt) => {
|
||||||
if (evt.name === "c" && !evt.ctrl && !evt.meta) {
|
if (evt.name === "c" && !evt.ctrl && !evt.meta) {
|
||||||
const code = props.authorization.instructions.match(/[A-Z0-9]{4}-[A-Z0-9]{4}/)?.[0] ?? props.authorization.url
|
const code = props.authorization.instructions.match(/[A-Z0-9]{4}-[A-Z0-9]{4,5}/)?.[0] ?? props.authorization.url
|
||||||
Clipboard.copy(code)
|
Clipboard.copy(code)
|
||||||
.then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
|
.then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
|
||||||
.catch(toast.error)
|
.catch(toast.error)
|
||||||
|
|||||||
Reference in New Issue
Block a user