Merge pull request #4817 from mempool/natsoni/fix-unnecessary-block-load
Fix unnecessary request of blocks on dashboard load
This commit is contained in:
commit
0b1296330b
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,13 @@ export const mockWebSocket = () => {
|
|||||||
win.mockServer = server;
|
win.mockServer = server;
|
||||||
win.mockServer.on('connection', (socket) => {
|
win.mockServer.on('connection', (socket) => {
|
||||||
win.mockSocket = socket;
|
win.mockSocket = socket;
|
||||||
win.mockSocket.send('{"action":"init"}');
|
win.mockSocket.send('{"conversions":{"USD":32365.338815782445}}');
|
||||||
|
cy.readFile('cypress/fixtures/mainnet_live2hchart.json', 'ascii').then((fixture) => {
|
||||||
|
win.mockSocket.send(JSON.stringify(fixture));
|
||||||
|
});
|
||||||
|
cy.readFile('cypress/fixtures/mainnet_mempoolInfo.json', 'ascii').then((fixture) => {
|
||||||
|
win.mockSocket.send(JSON.stringify(fixture));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
win.mockServer.on('message', (message) => {
|
win.mockServer.on('message', (message) => {
|
||||||
@ -75,8 +81,6 @@ export const emitMempoolInfo = ({
|
|||||||
|
|
||||||
switch (params.command) {
|
switch (params.command) {
|
||||||
case "init": {
|
case "init": {
|
||||||
win.mockSocket.send('{"action":"init"}');
|
|
||||||
win.mockSocket.send('{"action":"want","data":["blocks","stats","mempool-blocks","live-2h-chart"]}');
|
|
||||||
win.mockSocket.send('{"conversions":{"USD":32365.338815782445}}');
|
win.mockSocket.send('{"conversions":{"USD":32365.338815782445}}');
|
||||||
cy.readFile('cypress/fixtures/mainnet_live2hchart.json', 'ascii').then((fixture) => {
|
cy.readFile('cypress/fixtures/mainnet_live2hchart.json', 'ascii').then((fixture) => {
|
||||||
win.mockSocket.send(JSON.stringify(fixture));
|
win.mockSocket.send(JSON.stringify(fixture));
|
||||||
|
@ -24,7 +24,7 @@ export class StartComponent implements OnInit, AfterViewChecked, OnDestroy {
|
|||||||
timeLtrSubscription: Subscription;
|
timeLtrSubscription: Subscription;
|
||||||
timeLtr: boolean = this.stateService.timeLtr.value;
|
timeLtr: boolean = this.stateService.timeLtr.value;
|
||||||
chainTipSubscription: Subscription;
|
chainTipSubscription: Subscription;
|
||||||
chainTip: number = 100;
|
chainTip: number = -1;
|
||||||
tipIsSet: boolean = false;
|
tipIsSet: boolean = false;
|
||||||
lastMark: MarkBlockState;
|
lastMark: MarkBlockState;
|
||||||
markBlockSubscription: Subscription;
|
markBlockSubscription: Subscription;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user