For #675, needs more testing to know if it fixes it! (#784)

* for #675

* fix linting errors
This commit is contained in:
Cassie Tarakajian 2018-12-13 17:06:34 -05:00 committed by GitHub
parent eebe9d9252
commit 244af16b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import { browserHistory } from 'react-router';
import axios from 'axios';
import objectID from 'bson-objectid';
import each from 'async/each';
import { isEqual } from 'lodash';
import { isEqual, pick } from 'lodash';
import * as ActionTypes from '../../../constants';
import { showToast, setToastText } from './toast';
import { setUnsavedChanges,
@ -77,7 +77,10 @@ export function saveProject(autosave = false) {
.then((response) => {
const currentState = getState();
const savedProject = Object.assign({}, response.data);
if (!isEqual(currentState.files, response.data.files)) {
if (!isEqual(
pick(currentState.files, ['name', 'children', 'content']),
pick(response.data.files, ['name', 'children', 'content'])
)) {
savedProject.files = currentState.files;
dispatch(setUnsavedChanges(true));
} else {