Demystify Node state (#61)

This commit is contained in:
Maciej Hirsz
2018-09-27 21:30:51 +02:00
committed by GitHub
parent ae81485854
commit bc9d47d358
7 changed files with 157 additions and 97 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ import { Types } from '@dotstats/common';
import { Chains, Chain, Ago, OfflineIndicator } from './components';
import { Connection } from './Connection';
import { PersistentObject, PersistentSet } from './persist';
import { State, compareNodes } from './state';
import { State, Node } from './state';
import './App.css';
@@ -39,10 +39,10 @@ export default class App extends React.Component<{}, State> {
const { nodes, sortedNodes } = this.state;
for (const node of nodes.values()) {
node.pinned = pins.has(node.nodeDetails[0]);
node.pinned = pins.has(node.name);
}
this.setState({ nodes, pins, sortedNodes: sortedNodes.sort(compareNodes) });
this.setState({ nodes, pins, sortedNodes: sortedNodes.sort(Node.compare) });
});
this.state = {