Make 2nd file download async to fix (#9711)
# Addresses #9680 - Add 100ms timeout before 2nd key is downloaded from browser - Fix file decoding to correctly download both keys - Fix copy # Checklist for submitter - [x] Manual QA for all new/changed functionality Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Roberto Dip <roberto@fleetdm.com>
This commit is contained in:
co-authored by
Jacob Shandling
Roberto Dip
parent
c2d557588d
commit
429edde09f
@@ -105,7 +105,7 @@ const Mdm = (): JSX.Element => {
|
||||
|
||||
const privateFilename = "fleet-apple-mdm-bm-private.key";
|
||||
const privateFile = new global.window.File(
|
||||
[keys.decodedPublic],
|
||||
[keys.decodedPrivate],
|
||||
privateFilename,
|
||||
{
|
||||
type: "application/x-pem-file",
|
||||
@@ -113,7 +113,9 @@ const Mdm = (): JSX.Element => {
|
||||
);
|
||||
|
||||
FileSaver.saveAs(publicFile);
|
||||
FileSaver.saveAs(privateFile);
|
||||
setTimeout(() => {
|
||||
FileSaver.saveAs(privateFile);
|
||||
}, 100);
|
||||
} else {
|
||||
renderFlash(
|
||||
"error",
|
||||
|
||||
Reference in New Issue
Block a user