From e9c40692a6c5bbc43e614873096d8d300ee9198f Mon Sep 17 00:00:00 2001 From: natsoni Date: Wed, 3 Apr 2024 16:09:30 +0900 Subject: [PATCH] Fix network switch mechanism --- frontend/src/app/services/state.service.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index ee03246f7..e94428412 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -262,22 +262,10 @@ export class StateService { // /^\/ starts with a forward slash... // (?:[a-z]{2}(?:-[A-Z]{2})?\/)? optional locale prefix (non-capturing) // (?:preview\/)? optional "preview" prefix (non-capturing) - // (testnet|liquidtestnet|liquid|signet)/ network string (captured as networkMatches[1]) + // (testnet|signet)/ network string (captured as networkMatches[1]) // ($|\/) network string must end or end with a slash - const networkMatches = url.match(/^\/(?:[a-z]{2}(?:-[A-Z]{2})?\/)?(?:preview\/)?(testnet|liquidtestnet|liquid|signet)($|\/)/); + const networkMatches = url.match(/^\/(?:[a-z]{2}(?:-[A-Z]{2})?\/)?(?:preview\/)?(testnet|signet)($|\/)/); switch (networkMatches && networkMatches[1]) { - case 'liquid': - if (this.network !== 'liquid') { - this.network = 'liquid'; - this.networkChanged$.next('liquid'); - } - return; - case 'liquidtestnet': - if (this.network !== 'liquidtestnet') { - this.network = 'liquidtestnet'; - this.networkChanged$.next('liquidtestnet'); - } - return; case 'signet': if (this.network !== 'signet') { this.network = 'signet'; @@ -285,7 +273,7 @@ export class StateService { } return; case 'testnet': - if (this.network !== 'testnet') { + if (this.network !== 'testnet' && this.network !== 'liquidtestnet') { if (this.env.BASE_MODULE === 'liquid') { this.network = 'liquidtestnet'; this.networkChanged$.next('liquidtestnet');