Fix crash caused by typo
This commit is contained in:
@@ -46,7 +46,6 @@ class API extends EventEmitter {
|
||||
this._apiURL = null
|
||||
|
||||
const checkForToken = () => {
|
||||
console.log(`${this._backend} - ${this.apiURL}`)
|
||||
AsyncStorage.getItem(authTokenKeyName)
|
||||
.then((token) => {
|
||||
if (!token) {
|
||||
@@ -57,13 +56,11 @@ class API extends EventEmitter {
|
||||
return this.who()
|
||||
})
|
||||
.then((user) => {
|
||||
console.log("token good")
|
||||
this.user = user
|
||||
this.connectSocket()
|
||||
this.emit("login")
|
||||
})
|
||||
.catch(() => {
|
||||
console.log("token not present")
|
||||
AsyncStorage.removeItem(authTokenKeyName)
|
||||
this.token = null
|
||||
this.user = {}
|
||||
@@ -80,14 +77,12 @@ class API extends EventEmitter {
|
||||
if (!this.apiURL) {
|
||||
return Promise.reject()
|
||||
}
|
||||
console.log(`setting backend ${this._backend} - ${this.apiURL}`)
|
||||
checkForToken()
|
||||
})
|
||||
.catch(() => {
|
||||
this._backend = "normal"
|
||||
this.apiURL = baseURLS[this._backend]
|
||||
this.apiURL = API.urls[this._backend]
|
||||
AsyncStorage.setItem(backendKeyName, this._backend)
|
||||
console.log("setting default backend")
|
||||
checkForToken()
|
||||
})
|
||||
}
|
||||
@@ -175,7 +170,6 @@ class API extends EventEmitter {
|
||||
if (newBaseURL) {
|
||||
this.apiURL = newBaseURL
|
||||
this._backend = backend
|
||||
console.log(`setting backend ${this._backend} - ${this.apiURL}`)
|
||||
AsyncStorage.setItem(backendKeyName, this._backend).then(
|
||||
this.logout,
|
||||
this.logout
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export const localIPAddr = "192.168.1.175"
|
||||
export const defaultUser = "john@lyon-smith.org"
|
||||
// export const defaultUser = "john@lyon-smith.org"
|
||||
export const defaultUser = ""
|
||||
|
||||
Reference in New Issue
Block a user