mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Add default filename with date for export (#167)
This commit is contained in:
parent
b75d6536b7
commit
0d9d983fc5
@ -2,6 +2,7 @@ import electron from 'electron';
|
||||
import React from 'react';
|
||||
import {combineReducers} from 'redux';
|
||||
import fs from 'fs';
|
||||
import * as moment from 'moment';
|
||||
|
||||
import * as importUtils from '../../../common/import';
|
||||
import {trackEvent} from '../../../analytics';
|
||||
@ -182,9 +183,12 @@ export function exportFile (workspaceId = null) {
|
||||
|
||||
const workspace = await models.workspace.getById(workspaceId);
|
||||
const json = await importUtils.exportJSON(workspace);
|
||||
// Avoid colon for Windows
|
||||
let now = moment().format('D MMMM YYYY HH mm');
|
||||
const options = {
|
||||
title: 'Export Insomnia Data',
|
||||
buttonLabel: 'Export',
|
||||
defaultPath: 'Insomnia Export at ' + now,
|
||||
filters: [{
|
||||
name: 'Insomnia Export', extensions: ['json']
|
||||
}]
|
||||
|
Loading…
Reference in New Issue
Block a user