Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@action async getLoginParams(): Promise {
const loginParams = await AsyncStorage.getItem('loginParams')
if (loginParams) { return JSON.parse(loginParams) }
return null
}
componentDidMount() {
AsyncStorage.getItem(ACCESS_TOKEN).then(token => {
if (token) {
const { host, accessToken } = JSON.parse(token)
store.dispatch(actions.setAccessToken(host, accessToken))
}
this.setState({
loading: false
})
})
}
@action async getClientIdentifier(): Promise {
const value = await AsyncStorage.getItem('X-Plex-Client-Identifier')
if (value) { return value }
const newValue = UUID.v4()
await AsyncStorage.setItem('X-Plex-Client-Identifier', newValue)
return newValue
}