Skip to content

Commit

Permalink
Merge pull request RocketChat#302 from RocketChat/fix/181-debounce-wi…
Browse files Browse the repository at this point in the history
…ndow-save-state

Debounce saveState call
  • Loading branch information
engelgabriel committed Jan 20, 2017
2 parents b01e9ac + e7ad823 commit cd802e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"electron-notification-shim": "^1.1.0",
"electron-toaster": "^2.0.2",
"spellchecker": "3.3.1",
"lodash": "^4.17.4",
"electron-rebuild": "1.5.6"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/background/windowState.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { app } from 'electron';
import jetpack from 'fs-jetpack';
import _ from 'lodash';

export default function (name, defaults) {

Expand Down Expand Up @@ -47,6 +48,6 @@ export default function (name, defaults) {
get isMaximized () { return state.isMaximized; },
get isMinimized () { return state.isMinimized; },
get isHidden () { return state.isHidden; },
saveState: saveState
saveState: _.debounce(saveState, 1000)
};
}

0 comments on commit cd802e4

Please sign in to comment.