diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-16 00:56:43 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-16 00:56:43 +0200 |
commit | 674bc4273e9a2f1a2e41ef977a80219423c7cb51 (patch) | |
tree | b343902da8a0de10f075c46c75f8ad135bc23192 /web/src/js/stores/SettingsStore.es6.js | |
parent | acdd182754625fabcfc2c6ed4bdad8a63bce8ad6 (diff) | |
download | mitmproxy-674bc4273e9a2f1a2e41ef977a80219423c7cb51.tar.gz mitmproxy-674bc4273e9a2f1a2e41ef977a80219423c7cb51.tar.bz2 mitmproxy-674bc4273e9a2f1a2e41ef977a80219423c7cb51.zip |
format javascript
Diffstat (limited to 'web/src/js/stores/SettingsStore.es6.js')
-rw-r--r-- | web/src/js/stores/SettingsStore.es6.js | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/web/src/js/stores/SettingsStore.es6.js b/web/src/js/stores/SettingsStore.es6.js index dea4597c..2743161e 100644 --- a/web/src/js/stores/SettingsStore.es6.js +++ b/web/src/js/stores/SettingsStore.es6.js @@ -1,21 +1,26 @@ class _SettingsStore extends EventEmitter { - constructor() { - super(); - this.settings = { version: "0.12", showEventLog: true }; //FIXME: Need to get that from somewhere. - } - getAll() { - return this.settings; - } - handle(action) { - switch (action.actionType) { - case ActionTypes.SETTINGS_UPDATE: - this.settings = action.settings; - this.emit("change"); - break; - default: - return; - } - } + constructor() { + super(); + + //FIXME: What do we do if we haven't requested anything from the server yet? + this.settings = { + version: "0.12", + showEventLog: true + }; + } + getAll() { + return this.settings; + } + handle(action) { + switch (action.actionType) { + case ActionTypes.SETTINGS_UPDATE: + this.settings = action.settings; + this.emit("change"); + break; + default: + return; + } + } } var SettingsStore = new _SettingsStore(); -AppDispatcher.register(SettingsStore.handle.bind(SettingsStore)); +AppDispatcher.register(SettingsStore.handle.bind(SettingsStore));
\ No newline at end of file |