Authenticate server change

This commit is contained in:
Diego Mello 2020-04-13 17:49:42 -03:00
parent 1018fdfdb8
commit 455d76f599
1 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import { connect } from 'react-redux';
import equal from 'deep-equal';
import { withNavigation } from 'react-navigation';
import RNUserDefaults from 'rn-user-defaults';
import * as LocalAuthentication from 'expo-local-authentication';
import { toggleServerDropdown as toggleServerDropdownAction } from '../../actions/rooms';
import { selectServerRequest as selectServerRequestAction } from '../../actions/server';
@ -147,7 +148,12 @@ class ServerDropdown extends Component {
}, ANIMATION_DURATION);
}, ANIMATION_DURATION);
} else {
selectServerRequest(server);
const authResult = await LocalAuthentication.authenticateAsync();
if (authResult?.success) {
selectServerRequest(server);
} else {
alert('cancelled')
}
}
}
}