Add option to use full URL in QR codes instead of web+spoolman: prefix

This commit is contained in:
Michal Kunc
2024-02-10 00:09:39 +01:00
parent babb95d086
commit 30ee5b7cae
4 changed files with 14 additions and 3 deletions

View File

@@ -18,6 +18,11 @@ const QRCodeScannerModal: React.FC = () => {
setVisible(false);
navigate(`/spool/show/${match.groups.id}`);
}
const fullURLmatch = result.match(/^https?:\/\/[^/]+\/spool\/show\/(?<id>[0-9]+)$/);
if (fullURLmatch && fullURLmatch.groups) {
setVisible(false);
navigate(`/spool/show/${fullURLmatch.groups.id}`);
}
};
return (