[demo] better? demo mode
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { MempoolBlockDelta, MempoolBlockDeltaCompressed, MempoolDeltaChange, TransactionCompressed } from "../interfaces/websocket.interface";
|
||||
import { TransactionStripped } from "@interfaces/node-api.interface";
|
||||
import { AmountShortenerPipe } from "@app/shared/pipes/amount-shortener.pipe";
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
const amountShortenerPipe = new AmountShortenerPipe();
|
||||
|
||||
export function isMobile(): boolean {
|
||||
@@ -234,6 +235,21 @@ export function sleep$(ms: number): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export function handleDemoRedirect(route: ActivatedRoute, router: Router) {
|
||||
route.queryParams
|
||||
.subscribe(params => {
|
||||
if (params.next) {
|
||||
const path = ['/', '/acceleration', '/mining', '/lightning', '/graphs'];
|
||||
const index = path.indexOf(params.next);
|
||||
if (index >= 0) {
|
||||
const nextPath = path[(index + 1) % path.length];
|
||||
setTimeout(() => { window.location.replace(`${params.next}?next=${nextPath}`) }, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/60467595
|
||||
export function md5(inputString): string {
|
||||
var hc="0123456789abcdef";
|
||||
|
||||
Reference in New Issue
Block a user