mirror of
https://github.com/seigler/dash-visualizer
synced 2025-07-27 01:36:10 +00:00
🐛 Fix privatesend tx display on static blocks and live loading sequence
This commit is contained in:
parent
6bfef497a0
commit
0470dc0109
1 changed files with 24 additions and 18 deletions
18
app/App.js
18
app/App.js
|
@ -52,12 +52,13 @@ export default class App {
|
||||||
}
|
}
|
||||||
this.connectionStatus.className = 'is-loaded';
|
this.connectionStatus.className = 'is-loaded';
|
||||||
} else { // live display
|
} else { // live display
|
||||||
this.socket = io.connect("https://insight.dash.org:443/");
|
await fetch('https://insight.dash.org/api/status?q=getLastBlockHash')
|
||||||
fetch('https://insight.dash.org/api/status?q=getLastBlockHash')
|
|
||||||
.then(resp => resp.json())
|
.then(resp => resp.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
this.blockColors = App.generateColors(data.lastblockhash);
|
this.blockColors = App.generateColors(data.lastblockhash);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.socket = io.connect("https://insight.dash.org:443/");
|
||||||
this.socket.on('connect', () => {
|
this.socket.on('connect', () => {
|
||||||
this.connectionStatus.className = 'is-connected';
|
this.connectionStatus.className = 'is-connected';
|
||||||
// Join the room.
|
// Join the room.
|
||||||
|
@ -71,7 +72,6 @@ export default class App {
|
||||||
this.socket.on('reconnecting', () => {
|
this.socket.on('reconnecting', () => {
|
||||||
this.connectionStatus.className = 'is-connecting';
|
this.connectionStatus.className = 'is-connecting';
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ export default class App {
|
||||||
var blockColorScheme = new ColorScheme();
|
var blockColorScheme = new ColorScheme();
|
||||||
blockColorScheme.from_hue(hue).scheme(scheme).add_complement(true);
|
blockColorScheme.from_hue(hue).scheme(scheme).add_complement(true);
|
||||||
const colors = blockColorScheme.colors();
|
const colors = blockColorScheme.colors();
|
||||||
// console.log('New color scheme: ' + scheme + ' based on %chue ' + hue, 'background-color:#'+colors[0]);
|
console.log('New color scheme: ' + scheme + ' based on %chue ' + hue, 'background-color:#'+colors[0]);
|
||||||
return colors;
|
return colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,13 @@ export default class App {
|
||||||
}
|
}
|
||||||
|
|
||||||
static isPrivateSend(components) {
|
static isPrivateSend(components) {
|
||||||
return components.every(i => PSDENOMINATIONS.includes(Object.values(i)[0]));
|
return components.every(i => {
|
||||||
|
let value = Object.values(i)[0];
|
||||||
|
if (typeof value == 'string') {
|
||||||
|
value *= 100000000;
|
||||||
|
}
|
||||||
|
return PSDENOMINATIONS.includes(value);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onTransaction(data) {
|
onTransaction(data) {
|
||||||
|
@ -141,7 +147,7 @@ export default class App {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log('tx: '+tx.value+(tx.private?' private':'')+(tx.instant?' instant':''));
|
console.log('tx: '+tx.value+(tx.private?' private':'')+(tx.instant?' instant':''));
|
||||||
|
|
||||||
var paint = document.createElement('div');
|
var paint = document.createElement('div');
|
||||||
paint.classList.add('paint');
|
paint.classList.add('paint');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue