Skip to content

Commit

Permalink
merge iosfix
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsc committed Oct 19, 2023
2 parents aed44e2 + 0e99a4c commit f6d750c
Show file tree
Hide file tree
Showing 13 changed files with 328 additions and 45 deletions.
199 changes: 199 additions & 0 deletions ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
PODS:
- ByteowlsCapacitorOauth2 (5.0.0):
- Capacitor
- OAuthSwift (= 2.2.0)
- Capacitor (5.4.2):
- CapacitorCordova
- CapacitorApp (5.0.6):
- Capacitor
- CapacitorBrowser (5.1.0):
- Capacitor
- CapacitorClipboard (5.0.6):
- Capacitor
- CapacitorCordova (5.4.2)
- CapacitorDevice (5.0.6):
- Capacitor
- CapacitorHaptics (5.0.6):
- Capacitor
- CapacitorKeyboard (5.0.6):
- Capacitor
- CapacitorLocalNotifications (5.0.6):
- Capacitor
- CapacitorNavigationbarnx (0.0.2):
- Capacitor
- CapacitorPreferences (5.0.6):
- Capacitor
- CapacitorPushNotifications (5.1.0):
- Capacitor
- CapacitorSplashScreen (5.0.6):
- Capacitor
- CapacitorStatusBar (5.0.6):
- Capacitor
- CapacitorToast (5.0.6):
- Capacitor
- CordovaPlugins (5.4.2):
- CapacitorCordova
- Firebase/CoreOnly (9.2.0):
- FirebaseCore (= 9.2.0)
- Firebase/Messaging (9.2.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 9.2.0)
- FirebaseCore (9.2.0):
- FirebaseCoreDiagnostics (~> 9.0)
- FirebaseCoreInternal (~> 9.0)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- FirebaseCoreDiagnostics (9.2.0):
- GoogleDataTransport (< 10.0.0, >= 9.1.4)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- FirebaseCoreInternal (9.2.0):
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- FirebaseInstallations (9.2.0):
- FirebaseCore (~> 9.0)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/UserDefaults (~> 7.7)
- PromisesObjC (~> 2.1)
- FirebaseMessaging (9.2.0):
- FirebaseCore (~> 9.0)
- FirebaseInstallations (~> 9.0)
- GoogleDataTransport (< 10.0.0, >= 9.1.4)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Reachability (~> 7.7)
- GoogleUtilities/UserDefaults (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- GoogleDataTransport (9.1.4):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.7.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/Network (7.7.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.7.0)"
- GoogleUtilities/Reachability (7.7.0):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.7.0):
- GoogleUtilities/Logger
- nanopb (2.30909.0):
- nanopb/decode (= 2.30909.0)
- nanopb/encode (= 2.30909.0)
- nanopb/decode (2.30909.0)
- nanopb/encode (2.30909.0)
- OAuthSwift (2.2.0)
- PromisesObjC (2.1.1)

DEPENDENCIES:
- "ByteowlsCapacitorOauth2 (from `../../node_modules/@byteowls/capacitor-oauth2`)"
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
- "CapacitorBrowser (from `../../node_modules/@capacitor/browser`)"
- "CapacitorClipboard (from `../../node_modules/@capacitor/clipboard`)"
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
- "CapacitorDevice (from `../../node_modules/@capacitor/device`)"
- "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
- "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
- "CapacitorLocalNotifications (from `../../node_modules/@capacitor/local-notifications`)"
- CapacitorNavigationbarnx (from `../../node_modules/capacitor-navigationbarnx`)
- "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
- "CapacitorPushNotifications (from `../../node_modules/@capacitor/push-notifications`)"
- "CapacitorSplashScreen (from `../../node_modules/@capacitor/splash-screen`)"
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
- "CapacitorToast (from `../../node_modules/@capacitor/toast`)"
- CordovaPlugins (from `../capacitor-cordova-ios-plugins`)
- Firebase/Messaging
- FirebaseCore

SPEC REPOS:
trunk:
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseCoreInternal
- FirebaseInstallations
- FirebaseMessaging
- GoogleDataTransport
- GoogleUtilities
- nanopb
- OAuthSwift
- PromisesObjC

EXTERNAL SOURCES:
ByteowlsCapacitorOauth2:
:path: "../../node_modules/@byteowls/capacitor-oauth2"
Capacitor:
:path: "../../node_modules/@capacitor/ios"
CapacitorApp:
:path: "../../node_modules/@capacitor/app"
CapacitorBrowser:
:path: "../../node_modules/@capacitor/browser"
CapacitorClipboard:
:path: "../../node_modules/@capacitor/clipboard"
CapacitorCordova:
:path: "../../node_modules/@capacitor/ios"
CapacitorDevice:
:path: "../../node_modules/@capacitor/device"
CapacitorHaptics:
:path: "../../node_modules/@capacitor/haptics"
CapacitorKeyboard:
:path: "../../node_modules/@capacitor/keyboard"
CapacitorLocalNotifications:
:path: "../../node_modules/@capacitor/local-notifications"
CapacitorNavigationbarnx:
:path: "../../node_modules/capacitor-navigationbarnx"
CapacitorPreferences:
:path: "../../node_modules/@capacitor/preferences"
CapacitorPushNotifications:
:path: "../../node_modules/@capacitor/push-notifications"
CapacitorSplashScreen:
:path: "../../node_modules/@capacitor/splash-screen"
CapacitorStatusBar:
:path: "../../node_modules/@capacitor/status-bar"
CapacitorToast:
:path: "../../node_modules/@capacitor/toast"
CordovaPlugins:
:path: "../capacitor-cordova-ios-plugins"

SPEC CHECKSUMS:
ByteowlsCapacitorOauth2: dde6b8fdf2995bc7872434c407ee2492ce562638
Capacitor: 8a9db42d105f55843cd8ed2a3cb54e2b78e7f102
CapacitorApp: 963d90cb449803d58efc33bb515c81151e69159d
CapacitorBrowser: 31371ef981e378cb592be8cc203a9a4cbf43c486
CapacitorClipboard: ae6864d6b4ff2243fc7ce19124df307d8d1bb78d
CapacitorCordova: cfcc06b698481da655415985eeb2b8da363f8451
CapacitorDevice: 9233ba5f0c8f601bf4992006f5d2b2a86b7abc2e
CapacitorHaptics: 186982679c5f4005d1e6d2c719b8251c0d3a6df8
CapacitorKeyboard: 2f3296af2bc929a5069f02ed264fdce58ed62028
CapacitorLocalNotifications: 7ed607db672dc2834f22a25422b86e74129a032a
CapacitorNavigationbarnx: a22badd7d90d9715ecc08f3ae3824a57a37724b0
CapacitorPreferences: 8053abfef3bd11e3e83834792a97e5a6387bf591
CapacitorPushNotifications: 14425a66891d4134e73b6abe1932eeff37e4389d
CapacitorSplashScreen: f3c7de5468a52893e90f49d033772984270241b4
CapacitorStatusBar: a73a9ae0dd2ca30ee429782d5d3ae82dcfa80207
CapacitorToast: 61a9bec819ad3aeccc1ebe3fcbff565c22969c71
CordovaPlugins: 13d1f5b0b81c2eba67b8f70432c3edb07483877c
Firebase: 4ba896cb8e5105d4b9e247e1c1b6222b548df55a
FirebaseCore: 0e27f2a15d8f7b7ef11e7d93e23b1cbab55d748c
FirebaseCoreDiagnostics: ad3f6c68b7c5b63b7cf15b0785d7137f05f32268
FirebaseCoreInternal: cb966328b6985dbd6f535e1461291063e1c4a00f
FirebaseInstallations: 21186f0ca7849f90f4a3219fa31a5eca2e30f113
FirebaseMessaging: 4eaf1b8a7464b2c5e619ad66e9b20ee3e3206b24
GoogleDataTransport: 5fffe35792f8b96ec8d6775f5eccd83c998d5a3b
GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
OAuthSwift: 75efbb5bd9a4b2b71a37bd7e986bf3f55ddd54c6
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb

PODFILE CHECKSUM: 0abccb83d0d503da1628c7d1ca5579739161bb33

COCOAPODS: 1.10.2
8 changes: 4 additions & 4 deletions src/app/components/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
<ion-label>General</ion-label>
</ion-list-header>

<ion-list class="performance">
<ion-list class="performance" *ngIf="data.bestRank != 0">
<ion-item lines="none" *ngIf="data.bestRank == data.worstRank">
<ion-label class="stat-title">
<span tooltip="Global rank of this validator, based on last 7 days" placement="right" trigger="click" hideDelayAfterClick="5000"> Rank </span>
Expand All @@ -734,7 +734,7 @@
<ion-icon name="ribbon-outline" class="rank-ribbon"></ion-icon>

<span class="rank-text">
{{ data.bestRank | percentageabs : data.currentEpoch.validatorscount : rankPercentMode : 'Top ' }}
{{ data.bestRank | percentageabs : data.bestTopPercentage : rankPercentMode : 'Top ' }}
</span>
</ion-label>
</ion-item>
Expand All @@ -746,7 +746,7 @@
<ion-label class="value left">
<ion-icon name="ribbon-outline" class="rank-ribbon"></ion-icon>
<span class="rank-text">
{{ data.bestRank | percentageabs : data.currentEpoch.validatorscount : rankPercentMode : 'Top ' }}
{{ data.bestRank | percentageabs : data.bestTopPercentage : rankPercentMode : 'Top ' }}
</span>
</ion-label>
</div>
Expand All @@ -768,7 +768,7 @@
<ion-label class="value">
<ion-icon name="ribbon-outline" class="rank-ribbon"></ion-icon>
<span class="rank-text">
{{ data.worstRank | percentageabs : data.currentEpoch.validatorscount : rankPercentMode : 'Top ' }}
{{ data.worstRank | percentageabs : data.worstTopPercentage : rankPercentMode : 'Top ' }}
</span>
</ion-label>
</div>
Expand Down
25 changes: 23 additions & 2 deletions src/app/controllers/OverviewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export type OverviewData = {
activationeligibilityCount: number
bestRank: number
worstRank: number
bestTopPercentage: number
worstTopPercentage: number
displayAttrEffectiveness: boolean
attrEffectiveness: number

Expand Down Expand Up @@ -157,6 +159,7 @@ export default class OverviewController {
const overallBalance = this.sumBigIntBalanceRP(validators, (cur) => new BigNumber(cur.data.balance))
const validatorCount = validators.length
const activeValidators = this.getActiveValidators(validators)
const offlineValidators = this.getOfflineValidators(validators)

const consensusPerf = this.getConsensusPerformance(validators, validatorDepositActive)

Expand Down Expand Up @@ -190,8 +193,18 @@ export default class OverviewController {
}
}

const bestRank = findLowest(validators, (cur) => cur.data.rank7d)
const worstRank = findHighest(validators, (cur) => cur.data.rank7d)
let bestRank = 0
let bestTopPercentage = 0
let worstRank = 0
let worstTopPercentage = 0
const rankRelevantValidators = activeValidators.concat(offlineValidators)
if (rankRelevantValidators.length > 0) {
bestRank = findLowest(rankRelevantValidators, (cur) => cur.data.rank7d)
bestTopPercentage = findLowest(rankRelevantValidators, (cur) => cur.data.rankpercentage)
worstRank = findHighest(rankRelevantValidators, (cur) => cur.data.rank7d)
worstTopPercentage = findHighest(rankRelevantValidators, (cur) => cur.data.rankpercentage)
}

const rocketpoolValiCount = sumBigInt(validators, (cur) => (cur.rocketpool ? new BigNumber(1) : new BigNumber(0)))
const feeSum = sumBigInt(validators, (cur) =>
cur.rocketpool ? new BigNumber(cur.rocketpool.minipool_node_fee).multipliedBy('100') : new BigNumber('0')
Expand All @@ -213,7 +226,9 @@ export default class OverviewController {
overallBalance: overallBalance,
validatorCount: validatorCount,
bestRank: bestRank,
bestTopPercentage: bestTopPercentage,
worstRank: worstRank,
worstTopPercentage: worstTopPercentage,
attrEffectiveness: attrEffectiveness,
displayAttrEffectiveness: displayAttrEffectiveness,
consensusPerformance: consensusPerf,
Expand Down Expand Up @@ -810,6 +825,12 @@ export default class OverviewController {
})
}

private getOfflineValidators(validators: Validator[]) {
return validators.filter((item) => {
return item.state == ValidatorState.OFFLINE
})
}

private getSlashedValidators(validators: Validator[]) {
return validators.filter((item) => {
return item.state == ValidatorState.SLASHED
Expand Down
12 changes: 12 additions & 0 deletions src/app/pages/dev/dev.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
<ion-label>Set "Last Closed" to 0 for all clients</ion-label>
</ion-item>

<ion-item lines="none">
<ion-icon slot="start" name="bug-outline"></ion-icon>
<ion-toggle
id="nativeRequests"
[(ngModel)]="forceNativeRequests"
(ionChange)="changeForceNativeRequests()"
labelPlacement="start"
justify="space-between"
>Force All Native POST</ion-toggle
>
</ion-item>

<ion-item lines="none">
<ion-icon class="opacity-icon" slot="start" name="bug-outline"></ion-icon>
<ion-select label="Override Premium" value="" [(ngModel)]="packageOverride" (ionChange)="changePackage()" interface="popover">
Expand Down
10 changes: 10 additions & 0 deletions src/app/pages/dev/dev.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class DevPage extends Tab3Page implements OnInit {
packageOverride = 'default'
firebaseToken = ''
notificationConsent = false
forceNativeRequests = false

ngOnInit() {
this.notificationBase.disableToggleLock()
Expand All @@ -27,6 +28,7 @@ export class DevPage extends Tab3Page implements OnInit {
})

this.firebaseUtils.hasNotificationConsent().then((result) => (this.notificationConsent = result))
this.storage.getBooleanSetting('force_native_requests', false).then((result) => (this.forceNativeRequests = result))
}

// --- Development methods ---
Expand Down Expand Up @@ -106,6 +108,14 @@ export class DevPage extends Tab3Page implements OnInit {
})
}

changeForceNativeRequests() {
this.storage.setBooleanSetting('force_native_requests', this.forceNativeRequests)
console.log('forceNative changed to ' + this.forceNativeRequests)
this.alerts.confirmDialog('Restart', 'Requires restart to take affect, restart?', 'OK', () => {
this.restartApp()
})
}

restartApp() {
this.merchant.restartApp()
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/machines/machines.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@

<ion-label>Monitor your {{ api.getNetwork().name }} staking machines on the go.</ion-label>
<br /><br />
<ion-button (click)="login()" [hidden]="loggedIn">Login</ion-button>
<ion-button [disabled]="!loggedIn" (click)="openBrowser('https://kb.beaconcha.in/mobile-app-less-than-greater-than-beacon-node')"
<ion-button (click)="login()" *ngIf="!loggedIn">Login</ion-button>
<ion-button *ngIf="loggedIn" (click)="openBrowser('https://kb.beaconcha.in/mobile-app-less-than-greater-than-beacon-node')"
>Setup Monitoring</ion-button
>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/pages/machines/machines.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ export class MachinesPage extends MachineController implements OnInit {
}

lastEnter = 0
ionViewWillEnter() {
async ionViewWillEnter() {
if (this.lastEnter == 0 || this.lastEnter + 5 * 60 * 1000 < Date.now()) {
this.lastEnter = Date.now()
this.getAndProcessData()
}
this.loggedIn = await this.storage.isLoggedIn()
}

delegater(func) {
Expand Down
Loading

0 comments on commit f6d750c

Please sign in to comment.