Pin using names (#49 again) (#51)

This commit is contained in:
Maciej Hirsz
2018-09-24 21:53:16 +02:00
committed by GitHub
parent 5e995ea21d
commit e0012099c0
5 changed files with 13 additions and 12 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ import './App.css';
export default class App extends React.Component<{}, State> {
public state: State;
private readonly settings: PersistentObject<State.Settings>;
private readonly pins: PersistentSet<Types.NodeId>;
private readonly pins: PersistentSet<Types.NodeName>;
private readonly connection: Promise<Connection>;
constructor(props: {}) {
@@ -34,11 +34,11 @@ export default class App extends React.Component<{}, State> {
(settings) => this.setState({ settings })
);
this.pins = new PersistentSet<Types.NodeId>('pinned', (pins) => {
this.pins = new PersistentSet<Types.NodeName>('pinned_names', (pins) => {
const { nodes } = this.state;
for (const node of nodes.values()) {
node.pinned = pins.has(node.id);
node.pinned = pins.has(node.nodeDetails[0]);
}
this.setState({ nodes, pins });