summaryrefslogtreecommitdiffhomepage
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/backend.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index bc6eeeb8ff..02ab2717f0 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -112,7 +112,7 @@ export class Backend {
country: location.country,
city: location.city
};
- this._store.dispatch(connectionActions.connectionChange(newLocation));
+ this._store.dispatch(connectionActions.newLocation(newLocation));
})
.catch(e => {
log.info('Failed getting new location', e);
@@ -227,23 +227,18 @@ export class Backend {
});
}
- connect(addr: string) {
+ connect(addr: string): Promise<void> {
- this._store.dispatch(connectionActions.connectionChange({
- status: 'connecting',
- serverAddress: addr,
- }));
+ this._store.dispatch(connectionActions.connectingTo(addr));
- this._ipc.setCountry(addr)
+ return this._ipc.setCountry(addr)
.then( () => {
return this._ipc.connect();
})
.catch(e => {
log.info('Failed connecting to', addr, e);
- this._store.dispatch(connectionActions.connectionChange({
- status: 'disconnected',
- }));
+ this._store.dispatch(connectionActions.disconnected());
});
}