Abstract db (#165)

* Databases separated

* Refactor

* fix style

* database fix
This commit is contained in:
Guilherme Gazzo 2017-12-27 13:34:39 -02:00 committed by GitHub
parent d4e971f098
commit f5a9234600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -54,12 +54,12 @@ export default class Sidebar extends Component {
} }
componentWillMount() { componentWillMount() {
realm.databases.serversDB.addListener('change', this.updateState); database.databases.serversDB.addListener('change', this.updateState);
this.setState(this.getState()); this.setState(this.getState());
} }
componentWillUnmount() { componentWillUnmount() {
realm.databases.serversDB.removeListener('change', this.updateState); database.databases.serversDB.removeListener('change', this.updateState);
} }
onItemPress = ({ route, focused }) => { onItemPress = ({ route, focused }) => {
@ -75,7 +75,7 @@ export default class Sidebar extends Component {
} }
getState = () => ({ getState = () => ({
servers: realm.databases.serversDB.objects('servers') servers: database.databases.serversDB.objects('servers')
}) })
updateState = () => { updateState = () => {