From ef4449d1ed0380114262a5c8ed2eeb9efdaa0c0d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 14 Feb 2013 17:30:43 -0800 Subject: [PATCH] Don't store package state in command-panel package The package loader now only calls serialize if activate has been called and reuses the previous state if the package is never activated. --- src/packages/command-panel/lib/command-panel.coffee | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/packages/command-panel/lib/command-panel.coffee b/src/packages/command-panel/lib/command-panel.coffee index 1159e9ce4..43291ef80 100644 --- a/src/packages/command-panel/lib/command-panel.coffee +++ b/src/packages/command-panel/lib/command-panel.coffee @@ -3,15 +3,12 @@ CommandPanelView = require './command-panel-view' module.exports = commandPanelView: null - activate: (@state) -> - @commandPanelView = new CommandPanelView(@state) + activate: (state) -> + @commandPanelView = new CommandPanelView(state) deactivate: -> @commandPanelView?.destroy() @commandPanelView = null serialize: -> - if @commandPanelView? - @commandPanelView.serialize() - else - @state + @commandPanelView.serialize()