Skip to content

Commit bb854eb

Browse files
authored
Add disconnect hook to database plugin (#1332)
1 parent 86cfbb8 commit bb854eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/internal-plugins/database/lib/stores/collections-store.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ const CollectionsStore = Reflux.createStore({
4545

4646
onActivated(appRegistry) {
4747
appRegistry.on('database-changed', this.onDatabaseChanged.bind(this));
48+
appRegistry.on('data-service-disconnected', this.onDisconnected.bind(this));
4849
appRegistry.on('data-service-connected', (err, dataService) => {
4950
if (!err) {
5051
this.dataService = dataService;
5152
}
5253
});
5354
},
5455

56+
onDisconnected() {
57+
this.setState(this.getInitialState());
58+
},
59+
5560
getInitialState() {
5661
return {
5762
columns: COLL_COLUMNS,

0 commit comments

Comments
 (0)