Skip to content

Commit

Permalink
fixes for network switch
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsc committed Oct 19, 2023
1 parent 5adde0a commit 3179651
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
5 changes: 5 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"allowedCommonJsDependencies": [
"highcharts",
"ethereum-blockies",
"magic-snowflakes"
],
"assets": [
{
"glob": "**/*",
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* // along with Beaconchain Dashboard. If not, see <http://www.gnu.org/licenses/>.
*/

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'

Expand All @@ -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, {
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> {
Expand Down
8 changes: 8 additions & 0 deletions src/app/services/unitconv.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
1 change: 0 additions & 1 deletion src/app/tab-preferences/tab-preferences.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<ion-icon slot="start" name="wallet-outline" class="opacity-icon"></ion-icon>
<ion-select
label="Display Currency"
[value]="unit.getNetworkDefaultCurrency(unit.pref.Cons)"
[(ngModel)]="currentFiatCurrency"
(ionChange)="changeCurrency()"
interface="popover"
Expand Down
1 change: 1 addition & 0 deletions src/app/tab-preferences/tab-preferences.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export class Tab3Page {
await this.api.initialize()
await this.notificationBase.loadAllToggles()
await this.unit.networkSwitchReload()
//await this.unit.changeCurrency(this.currentFiatCurrency)
this.validatorUtils.notifyListeners()
}

Expand Down

0 comments on commit 3179651

Please sign in to comment.