@journeyapps-labs/reactor-mod-data-browser 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@journeyapps-labs/reactor-mod-data-browser",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "main": "./dist/index.js",
5
5
  "typings": "./dist/@types/index",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  import { AbstractStore, LocalStorageSerializer } from '@journeyapps-labs/reactor-mod';
2
2
  import { AbstractConnection, AbstractConnectionSerialized } from '../core/AbstractConnection';
3
- import { action, computed, observable, when } from 'mobx';
3
+ import { action, computed, observable, runInAction, when } from 'mobx';
4
4
  import { AbstractConnectionFactory } from '../core/AbstractConnectionFactory';
5
5
 
6
6
  export interface ConnectionStoreSerialized {
@@ -56,15 +56,17 @@ export class ConnectionStore extends AbstractStore<ConnectionStoreSerialized> {
56
56
  return conn;
57
57
  }
58
58
 
59
- @action
60
59
  protected async deserialize(data: ConnectionStoreSerialized) {
61
- let connections = await Promise.all(
62
- data.connections.map((connSer) => {
63
- return this.deserializeConnection(connSer);
64
- })
65
- );
66
- connections.forEach((c) => {
67
- this.addConnection(c);
60
+ await runInAction(async () => {
61
+ this._connections.clear();
62
+ let connections = await Promise.all(
63
+ data.connections.map((connSer) => {
64
+ return this.deserializeConnection(connSer);
65
+ })
66
+ );
67
+ connections.forEach((c) => {
68
+ this.addConnection(c);
69
+ });
68
70
  });
69
71
  }
70
72