From f5a92346005b19a20aadbabd51b3bd84d40d286f Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 27 Dec 2017 13:34:39 -0200 Subject: [PATCH] Abstract db (#165) * Databases separated * Refactor * fix style * database fix --- app/containers/Sidebar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/containers/Sidebar.js b/app/containers/Sidebar.js index e4f96875b..c93f5857b 100644 --- a/app/containers/Sidebar.js +++ b/app/containers/Sidebar.js @@ -54,12 +54,12 @@ export default class Sidebar extends Component { } componentWillMount() { - realm.databases.serversDB.addListener('change', this.updateState); + database.databases.serversDB.addListener('change', this.updateState); this.setState(this.getState()); } componentWillUnmount() { - realm.databases.serversDB.removeListener('change', this.updateState); + database.databases.serversDB.removeListener('change', this.updateState); } onItemPress = ({ route, focused }) => { @@ -75,7 +75,7 @@ export default class Sidebar extends Component { } getState = () => ({ - servers: realm.databases.serversDB.objects('servers') + servers: database.databases.serversDB.objects('servers') }) updateState = () => {