Abstract db (#165)
* Databases separated * Refactor * fix style * database fix
This commit is contained in:
parent
d4e971f098
commit
f5a9234600
|
@ -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 = () => {
|
||||||
|
|
Loading…
Reference in New Issue