Skip to content

Commit

Permalink
Merge pull request #6591 from RocketChat/hotfix/one-password-not-defined
Browse files Browse the repository at this point in the history
Fix recently introduced bug: OnePassword not defined
  • Loading branch information
engelgabriel authored Apr 4, 2017
2 parents 413ac7a + cb2e3d6 commit c732a80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-login/client/login/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Template.loginForm.helpers({
return RocketChat.settings.get('Accounts_PasswordPlaceholder') || t('Password');
},
hasOnePassword() {
return (OnePassword && OnePassword.findLoginForUrl) && (device && device.platform && device.platform.toLocaleLowerCase() === 'ios');
return typeof OnePassword !== 'undefined' && OnePassword.findLoginForUrl && typeof device !== 'undefined' && device.platform && device.platform.toLocaleLowerCase() === 'ios';
}
});

Expand Down Expand Up @@ -151,7 +151,7 @@ Template.loginForm.events({
return RocketChat.callbacks.run('loginPageStateChange', Template.instance().state.get());
},
'click .one-passsword'() {
if (OnePassword && OnePassword.findLoginForUrl) {
if (typeof OnePassword === 'undefined' || OnePassword.findLoginForUrl == null) {
return;
}
const succesCallback = function(credentials) {
Expand Down

0 comments on commit c732a80

Please sign in to comment.