From 3179651698ef3dd8b21d3a92b38ef7c1cd40bd4a Mon Sep 17 00:00:00 2001 From: Manuel <5877862+manuelsc@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:21:46 +0200 Subject: [PATCH] fixes for network switch --- README.md | 4 ++-- angular.json | 5 +++++ package-lock.json | 14 +++++++------- package.json | 2 +- src/app/app.module.ts | 3 ++- src/app/services/storage.service.ts | 2 +- src/app/services/unitconv.service.ts | 8 ++++++++ src/app/tab-preferences/tab-preferences.page.html | 1 - src/app/tab-preferences/tab-preferences.page.ts | 1 + 9 files changed, 27 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 16fd2006..bb4e7704 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Build the the app at least once before proceeding: Make sure port 8100 is accessable on your computer and use the following command to run a livereload server -`ionic capacitor run android --livereload --external --host=192.168.0.124 --disableHostCheck` +`ionic cap run android --livereload --external --host=192.168.1.64 --disableHostCheck --configuration=development` Adapt the --host param to match your computers IP. @@ -98,7 +98,7 @@ Build the the app at least once before proceeding: Make sure port 8100 is accessable on your mac and use the following command to run a livereload server -`ionic capacitor run ios --livereload --external --host=192.168.0.124 --disableHostCheck` +`ionic cap run ios --livereload --external --host=192.168.1.64 --disableHostCheck --configuration=development` Adapt the --host param to match your macs IP. diff --git a/angular.json b/angular.json index ca614137..4832ba80 100644 --- a/angular.json +++ b/angular.json @@ -19,6 +19,11 @@ "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", + "allowedCommonJsDependencies": [ + "highcharts", + "ethereum-blockies", + "magic-snowflakes" + ], "assets": [ { "glob": "**/*", diff --git a/package-lock.json b/package-lock.json index b022ec93..0c6866d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "@ionic/angular": "^7.4.3", "async-mutex": "^0.2.6", "axios": "^0.27.2", - "bignumber.js": "^9.0.2", + "bignumber.js": "^9.1.2", "canvas-confetti": "^1.3.3", "capacitor-navigationbarnx": "0.1.6", "cordova-plugin-purchase": "^13.8.6", @@ -5849,9 +5849,9 @@ } }, "node_modules/bignumber.js": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", - "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "engines": { "node": "*" } @@ -21102,9 +21102,9 @@ "dev": true }, "bignumber.js": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", - "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==" }, "binary-extensions": { "version": "2.1.0", diff --git a/package.json b/package.json index 58e5e9b8..95c7eff2 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@ionic/angular": "^7.4.3", "async-mutex": "^0.2.6", "axios": "^0.27.2", - "bignumber.js": "^9.0.2", + "bignumber.js": "^9.1.2", "canvas-confetti": "^1.3.3", "capacitor-navigationbarnx": "0.1.6", "cordova-plugin-purchase": "^13.8.6", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 59f0ae2a..ac0d8dd7 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -18,7 +18,7 @@ * // along with Beaconchain Dashboard. If not, see . */ -import { APP_INITIALIZER, NgModule } from '@angular/core' +import { APP_INITIALIZER, Injectable, NgModule } from '@angular/core' import { BrowserModule, HammerModule } from '@angular/platform-browser' import { RouteReuseStrategy } from '@angular/router' @@ -34,6 +34,7 @@ import { ApiService, initializeApiService } from './services/api.service' // eslint-disable-next-line @typescript-eslint/no-explicit-any declare let Hammer: any +@Injectable() export class MyHammerConfig extends HammerGestureConfig { buildHammer(element: HTMLElement) { const mc = new Hammer(element, { diff --git a/src/app/services/storage.service.ts b/src/app/services/storage.service.ts index 71a0b37b..9f6db1ef 100644 --- a/src/app/services/storage.service.ts +++ b/src/app/services/storage.service.ts @@ -92,7 +92,7 @@ export class StorageService extends CacheModule { } async setNetworkPreferences(value: StorageTypes.ApiNetwork) { - return this.setObject(PREFERENCES, value) + return await this.setObject(PREFERENCES, value) } async loadPreferencesToggles(network: string): Promise { diff --git a/src/app/services/unitconv.service.ts b/src/app/services/unitconv.service.ts index 0f6827a5..362ded39 100644 --- a/src/app/services/unitconv.service.ts +++ b/src/app/services/unitconv.service.ts @@ -78,7 +78,15 @@ export class UnitconvService { } public async changeCurrency(value: string) { + UnitconvService.currencyPipe = { Cons: null, Exec: null, RPL: null } + this.pref.Cons = this.createCurrency(value, 'cons') + if (this.isDefaultCurrency(this.pref.Cons)) { + this.pref.Exec = this.createCurrency(this.getNetworkDefaultCurrency(this.pref.Exec), 'exec') + } else { + this.pref.Exec = this.createCurrency(value, 'exec') + } + await this.updatePriceData() } diff --git a/src/app/tab-preferences/tab-preferences.page.html b/src/app/tab-preferences/tab-preferences.page.html index 14b858c5..8151fb06 100644 --- a/src/app/tab-preferences/tab-preferences.page.html +++ b/src/app/tab-preferences/tab-preferences.page.html @@ -55,7 +55,6 @@