commit
5619420302
2 changed files with 12 additions and 0 deletions
|
@ -281,6 +281,15 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
settings.password = '';
|
settings.password = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if user decides to save password, and copy it over
|
||||||
|
settings.addCallback('savepassword', function(newvalue) {
|
||||||
|
if (settings.savepassword) {
|
||||||
|
// Init value in settings module
|
||||||
|
settings.setDefaults({'password': $scope.password});
|
||||||
|
settings.password = $scope.password;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$rootScope.wasMobileUi = false;
|
$rootScope.wasMobileUi = false;
|
||||||
if (utils.isMobileUi()) {
|
if (utils.isMobileUi()) {
|
||||||
$rootScope.wasMobileUi = true;
|
$rootScope.wasMobileUi = true;
|
||||||
|
|
|
@ -57,6 +57,9 @@ weechat.factory('settings', ['$store', '$rootScope', function($store, $rootScope
|
||||||
for (var key in defaults) {
|
for (var key in defaults) {
|
||||||
// null means the key isn't set
|
// null means the key isn't set
|
||||||
if ($store.get(key) === null) {
|
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];
|
this[key] = defaults[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue