converse-desktop/app/controllers/login-controller.js

22 lines
722 B
JavaScript
Raw Normal View History

const angApp = (await import('../init.js')).default;
2020-05-09 15:07:42 +00:00
2021-02-13 02:52:49 +00:00
angApp.controller('LoginController', function($scope, DesktopService, CredentialsService) {
2020-05-11 18:26:51 +00:00
$scope.help = {}
$scope.showHelp = (item) => {
$scope.help[item] = typeof $scope.help[item] === 'undefined' ? true : !$scope.help[item];
}
2020-05-09 15:07:42 +00:00
$scope.addAccountAndLoginAction = () => {
2021-02-13 02:52:49 +00:00
CredentialsService.addCredentials($scope.credentials.connectionManager,
2020-05-11 18:26:51 +00:00
$scope.credentials.login,
$scope.credentials.password
2022-01-05 19:44:36 +00:00
).then(()=>{
DesktopService.getCredentialsAndLogin()
});
2020-05-11 18:26:51 +00:00
$scope.accountForm.$setPristine()
$scope.accountForm.$setUntouched()
$scope.credentials = {}
2020-05-09 15:07:42 +00:00
}
2020-05-13 20:00:36 +00:00
})