Store token key in constants

This commit is contained in:
Jake Howard 2016-05-05 18:25:45 +01:00
parent 87c6748037
commit 2c01bf05fa
2 changed files with 6 additions and 6 deletions

View file

@ -1,13 +1,12 @@
import { AsyncStorage } from 'react-native'; import { AsyncStorage } from 'react-native';
import settings from '../settings/constants';
const STORAGE_KEY = 'CIRCLE_TOKEN';
async function get() { async function get() {
return await AsyncStorage.getItem(STORAGE_KEY); return await AsyncStorage.getItem(settings.get('STORAGE_KEY'));
} }
async function set(token) { async function set(token) {
return await AsyncStorage.setItem(STORAGE_KEY, token); return await AsyncStorage.setItem(settings.get('STORAGE_KEY'), token);
} }
export default { get, set }; export default { get, set };

View file

@ -4,5 +4,6 @@ export default Map({
PROJECT_DATA: { PROJECT_DATA: {
repository: 'https://github.com/RealOrangeOne/Sphere', repository: 'https://github.com/RealOrangeOne/Sphere',
CI_Badge: 'https://circleci.com/gh/RealOrangeOne/Sphere.svg?style=svg' CI_Badge: 'https://circleci.com/gh/RealOrangeOne/Sphere.svg?style=svg'
} },
STORAGE_KEY: 'CIRCLE_TOKEN'
}); });