Add default filename with date for export (#167)

This commit is contained in:
Gregory Schier 2017-05-08 13:01:10 -07:00 committed by GitHub
parent b75d6536b7
commit 0d9d983fc5

View File

@ -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']
}]