Skip to content

Commit

Permalink
Cr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Sep 12, 2023
1 parent adfaae6 commit ce90eb1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/features/hotspot-onboarding/iot-ble/AddGatewayBle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ const AddGatewayBle = () => {

if (!onboardRecord) {
throw new Error(
`This hotspot does not exist in the onboarding server. Contact your manufacturer to have them approve hotspot with id ${onboardAddress}`,
t('hotspotOnboarding.onboarding.hotspotNotFound', {
onboardAddress,
}),
)
}

if (!onboardRecord?.maker.address) {
throw new Error('Could not get maker address')
throw new Error(t('hotspotOnboarding.onboarding.makerNotFound'))
}
const makerSolAddr = heliumAddressToSolAddress(onboardRecord?.maker.address)
const makerSolBalance = (
Expand All @@ -83,7 +85,9 @@ const AddGatewayBle = () => {
makerSolBalance / LAMPORTS_PER_SOL < 0.00089088 + 0.00001
) {
throw new Error(
`Manufacturer ${onboardRecord?.maker.name} does not have enough SOL to onboard this hotspot. Please contact the manufacturer to resolve this issue.`,
t('hotspotOnboarding.onboarding.manufacturerMissingSol', {
name: onboardRecord?.maker.name,
}),
)
}

Expand All @@ -104,7 +108,9 @@ const AddGatewayBle = () => {
e.InstructionError[1].Custom === 1
) {
throw new Error(
`Manufacturer ${onboardRecord?.maker.name} does not have enough SOL or Data Credits to onboard this hotspot. Please contact the manufacturer to resolve this issue.`,
t('hotspotOnboarding.onboarding.manufacturerMissingDcOrSol', {
name: onboardRecord?.maker.name,
}),
)
}
if (e.InstructionError) {
Expand Down
7 changes: 7 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export default {
subtitle:
'Onboard your Hotspot to the IOT network. After onboarding this Hotspot, you will be able to set the location and antenna details.',
onboard: 'Onboard Hotspot',
hotspotNotFound:
'This hotspot does not exist in the onboarding server. Contact your manufacturer to have them approve hotspot with id {{onboardAddress}}',
makerNotFound: 'Maker does not exist',
manufacturerMissingSol:
'Manufacturer {{name}} does not have enough SOL to onboard this hotspot. Please contact the manufacturer to resolve this issue.',
manufacturerMissingDcOrSol:
'Manufacturer {{name}} does not have enough Data Credits or SOL to onboard this hotspot. Please contact the manufacturer to resolve this issue.',
},
selectOnboardingMethod: {
title: 'Select Onboarding Method',
Expand Down
1 change: 0 additions & 1 deletion src/utils/walletApiV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { getSecureItem } from '../storage/secureStorage'
import { AccountBalance, Prices } from '../types/balance'
import makeApiToken from './makeApiToken'
import { CSAccount } from '../storage/cloudStorage'
import { OnboardableDevice } from '../features/hotspot-onboarding/navTypes'

export type Notification = {
title: string
Expand Down

0 comments on commit ce90eb1

Please sign in to comment.