save defaults to $store

This commit is contained in:
Tor Hveem 2015-03-02 22:08:45 +01:00
parent ba5bca9c8e
commit c7de58d125
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ weechat.factory('settings', ['$store', '$rootScope', function($store, $rootScope
for (var key in defaults) {
// null means the key isn't set
if ($store.get(key) === null) {
// Define property so it will get saved to store
defineProperty(key);
// Save to settings module AND to store
this[key] = defaults[key];
}
}