@@ -2,12 +2,12 @@ import _ from 'lodash';
22import axios from "axios" ;
33import * as traverse from 'traverse' ;
44import * as FileSaver from 'file-saver' ;
5-
6- import * as configuration from "./configuration" ;
5+ import moment from "moment" ;
76
87import { store } from '../store' ;
98import * as actionTypes from '../actions/actionTypes' ;
109import * as settingsAction from "../actions/settingsAction" ;
10+ import * as configuration from "./configuration" ;
1111
1212const DEBUG = process . env . REACT_APP_DEBUG ;
1313let totalRequests = 0 , completedRequests = 0 ;
@@ -145,10 +145,11 @@ export function handleCreatePackage(builder, elements) {
145145 store . dispatch ( { type : actionTypes . LOADING , loading : true } ) ;
146146 initialFetchAndRetrieve ( builder , elements ) . then ( ( ) => {
147147 createPackage ( builder , elements ) . then ( ( result ) => {
148+ let fileName = 'extraction-' + moment ( ) . format ( 'YYMMDDHHmm' ) + '.json' ;
148149 FileSaver . saveAs ( new Blob ( [ JSON . stringify ( result , null , 4 ) ] , {
149150 type : 'application/json' ,
150- name : 'extraction.json'
151- } ) , 'extraction.json' ) ;
151+ name : fileName
152+ } ) , fileName ) ;
152153 store . dispatch ( { type : actionTypes . LOADING , loading : false } ) ;
153154 } ) ;
154155 } ) ;
0 commit comments