From 933dc9c3783671496be837b49c78bca39414272f Mon Sep 17 00:00:00 2001 From: Shivank Date: Wed, 30 Oct 2019 11:06:25 +0530 Subject: [PATCH] Second File-saver patch --- .../cc/ui/src/components/pages/ConfigurePage.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index a5aeae3ec..5cbd758cf 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -1,7 +1,7 @@ import React from 'react'; import Form from 'react-jsonschema-form'; import {Col, Modal, Nav, NavItem} from 'react-bootstrap'; -import FileSaver from "file-saver"; +import FileSaver from 'file-saver'; import AuthComponent from '../AuthComponent'; import { FilePond } from 'react-filepond'; import 'filepond/dist/filepond.min.css'; @@ -309,10 +309,10 @@ class ConfigurePageComponent extends AuthComponent { exportConfig = () => { this.updateConfigSection(); - const JSONString = JSON.stringify(this.state.configuration, null, 2); - const blob = new Blob([JSONString], {type: "text/plain;charset=utf-8"}); + const configAsJson = JSON.stringify(this.state.configuration, null, 2); + const configAsBinary = new Blob([configAsJson], {type: "text/plain;charset=utf-8"}); - FileSaver.saveAs(blob, 'monkey.conf'); + FileSaver.saveAs(configAsBinary, 'monkey.conf'); }; sendConfig() {