Skip to content

Commit

Permalink
Release v1.5.0 Merged Develop
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnymac committed Sep 7, 2016
2 parents 265bed1 + 437a92b commit 327c600
Show file tree
Hide file tree
Showing 194 changed files with 2,445 additions and 1,330 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

**PokéNurse** is a desktop application for Windows and Mac that allows you to manage your pokémon from Pokémon Go without the need for a mobile device. You can now favorite, transfer, and evolve from the comfort of your own home!

## Downloads for v1.4.0
## Downloads for v1.5.0
You may view all the releases [here](https://github.com/vinnymac/PokeNurse/releases)
* [Mac OS X](https://github.com/vinnymac/PokeNurse/releases/download/v1.4.0/PokeNurse-darwin-x64.zip)
* [Windows 32 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.4.0/PokeNurse-win32-ia32.zip)
* [Windows 64 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.4.0/PokeNurse-win32-x64.zip)
* [Linux 32 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.4.0/PokeNurse-linux-ia32.zip)
* [Linux 64 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.4.0/PokeNurse-linux-x64.zip)
* [Mac OS X](https://github.com/vinnymac/PokeNurse/releases/download/v1.5.0/PokeNurse-darwin-x64.zip)
* [Windows 32 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.5.0/PokeNurse-win32-ia32.zip)
* [Windows 64 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.5.0/PokeNurse-win32-x64.zip)
* [Linux 32 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.5.0/PokeNurse-linux-ia32.zip)
* [Linux 64 bit](https://github.com/vinnymac/PokeNurse/releases/download/v1.5.0/PokeNurse-linux-x64.zip)

## Examples
![Login Window](app/loginExample.png)
Expand Down
91 changes: 91 additions & 0 deletions app/actions/authenticate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import path from 'path'
import pogobuf from 'pogobuf'
import {
remote
} from 'electron'
import {
createAction
} from 'redux-actions'

import * as fs from 'async-file'

import client from '../client'

import {
getTrainerInfo,
getTrainerPokemon
} from './trainer'

const saveAccountCredentialsFailed = createAction('SAVE_ACCOUNT_CREDENTIALS_FAILED')
const saveAccountCredentialsSuccess = createAction('SAVE_ACCOUNT_CREDENTIALS_SUCCESS')

const checkAndDeleteCredentialsFailed = createAction('CHECK_AND_DELETE_CREDENTIALS_FAILED')
const checkAndDeleteCredentialsSuccess = createAction('CHECK_AND_DELETE_CREDENTIALS_SUCCESS')

const userLoginStarted = createAction('USER_LOGIN_STARTED')
const userLoginSuccess = createAction('USER_LOGIN_SUCCESS')
const userLoginFailed = createAction('USER_LOGIN_FAILED')

const accountPath = path.join(remote.app.getPath('appData'), '/pokenurse/account.json')

export default {
client,

login({ method, username, password }) {
return async (dispatch) => {
dispatch(userLoginStarted())

let login
if (method === 'google') {
login = new pogobuf.GoogleLogin()
} else {
login = new pogobuf.PTCLogin()
}

try {
const token = await login.login(username, password)

client.setAuthInfo(method, token)
client.init()

// TODO display a loading spinner
// then fetch all necessary things
await Promise.all([
dispatch(getTrainerInfo()),
dispatch(getTrainerPokemon())
])

dispatch(userLoginSuccess())
} catch (error) {
console.error(error) // eslint-disable-line
dispatch(userLoginFailed({ error }))
}
}
},

logout: createAction('USER_LOGOUT'),

checkAndDeleteCredentials() {
return async (dispatch) => {
try {
if (await fs.exists(accountPath)) {
await fs.unlink(accountPath)
}
dispatch(checkAndDeleteCredentialsSuccess())
} catch (error) {
dispatch(checkAndDeleteCredentialsFailed())
}
}
},

saveAccountCredentials(credentials) {
return async (dispatch) => {
try {
const response = await fs.writeFile(accountPath, JSON.stringify(credentials))
dispatch(saveAccountCredentialsSuccess({ response, credentials }))
} catch (error) {
dispatch(saveAccountCredentialsFailed(error))
}
}
}
}
8 changes: 7 additions & 1 deletion app/actions/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import * as statusActions from './status'
import * as authenticateActions from './authenticate'
import * as trainerActions from './trainer'
import * as settingsActions from './settings'

export default {
...statusActions
...statusActions,
...authenticateActions,
...trainerActions,
...settingsActions,
}
13 changes: 13 additions & 0 deletions app/actions/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
createAction
} from 'redux-actions'

export default {
toggleShowSpeciesWithZeroPokemon: createAction('TOGGLE_SHOW_SPECIES_WITH_ZERO_POKEMON'),
toggleAutoLogin: createAction('TOGGLE_AUTO_LOGIN'),
resetAllSettings: createAction('RESET_ALL_SETTINGS'),
changeDefaultPokedexSortBy: createAction('CHANGE_DEFAULT_POKEDEX_SORT_BY'),
changeDefaultPokedexSortDirection: createAction('CHANGE_DEFAULT_POKEDEX_SORT_DIRECTION'),
changeDefaultSpecieSortBy: createAction('CHANGE_DEFAULT_SPECIE_SORT_BY'),
changeDefaultSpecieSortDirection: createAction('CHANGE_DEFAULT_SPECIE_SORT_DIRECTION'),
}
Loading

0 comments on commit 327c600

Please sign in to comment.