Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next -> Master #805

Merged
merged 16 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-mainnet-explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
AWS_DEFAULT_REGION: eu-central-1
AWS_DISTRIBUTION_ID: ${{ secrets.AWS_DISTRIBUTION_ID_MAINNET }}
AWS_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME_MAINNET }}
VITE_BACKEND_URL: https://backend-8dce19.alephium.org
VITE_BACKEND_URL: https://backend.mainnet.alephium.org
VITE_NETWORK_TYPE: mainnet
VITE_NODE_URL: https://node.mainnet.alephium.org

Expand Down
7 changes: 7 additions & 0 deletions apps/mobile-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @alephium/mobile-wallet

## 1.1.5

### Patch Changes

- 52a5834: Fix wallet delete
- 5e8c14b: Do not display authentication modal on app fresh install

## 1.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile-wallet/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.1.4"
versionName "1.1.5"
}
signingConfigs {
debug {
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile-wallet/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
name: 'Alephium',
owner: 'alephium-dev',
slug: 'alephium-mobile-wallet',
version: '1.1.4',
version: '1.1.5',
orientation: 'portrait',
icon: './assets/icon.png',
scheme: ['wc', 'alephium'],
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile-wallet/ios/Alephium/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.1.4</string>
<string>1.1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile-wallet/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ PODS:
- React-Core
- react-native-background-timer (2.4.1):
- React-Core
- react-native-compat (2.13.3):
- react-native-compat (2.15.1):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2104,7 +2104,7 @@ SPEC CHECKSUMS:
react-native-aes: c75c46aa744bef7c2415fdf7f5b2dcb75ca4364d
react-native-background-actions: ecffd3f0864140ef6cf21c29be6819a02b531a52
react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe
react-native-compat: 0767233bce5123adae8d0338ce121147f195cbd9
react-native-compat: 408a4b320fa4426f2c25ab74ed5764be6b3eb5aa
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
react-native-netinfo: bdb108d340cdb41875c9ced535977cac6d2ff321
react-native-pager-view: c1e29e1a6105a02807392ba822ad322447a72f55
Expand Down
7 changes: 4 additions & 3 deletions apps/mobile-wallet/locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,9 @@
"Help us improve your experience!": "Helfen Sie uns, Ihr Erlebnis zu verbessern!",
"Require biometrics to open app": "Biometrie zum Öffnen der App erforderlich",
"Require device passcode to open app": "Geräte-Zugangscode zum Öffnen der App erforderlich",
"Require device screen lock code or pattern to open app": "Gerät Displaysperre Code oder Muster zum Öffnen der App erforderlich",
"App access": "App-Zugriff",
"Require biometrics to transact": "Benötigt biometrische Daten für Transaktionen",
"Require device passcode to transact": "Geräte-Zugangscode für Transaktionen erforderlich",
"Require device screen lock code or pattern to transact": "Gerät Displaysperre Code oder Muster für Transaktionen erforderlich",
"Your device supports biometrics but none is enrolled. Enable them by adding a fingerprint or Face ID in your device's settings.": "Ihr Gerät unterstützt biometrische Daten, aber keine sind hinterlegt. Aktivieren Sie sie, indem Sie einen Fingerabdruck oder eine Gesichts-ID in den Einstellungen Ihres Geräts hinzufügen.",
"Enhance your security": "Verbessern Sie Ihre Sicherheit",
"Auto-lock": "Automatisch sperren",
Expand Down Expand Up @@ -364,5 +362,8 @@
"Error while copying address": "Fehler beim Kopieren der Adresse",
"This address is not valid": "Diese Adresse ist nicht gültig",
"A number is expected": "Eine Zahl wird erwartet",
"View full size": "Volle Grösse anzeigen"
"View full size": "Volle Grösse anzeigen",
"Disclaimer": "Haftungsausschluss",
"Buy": "Kaufen",
"banxaDisclaimer": "Sie sind dabei, auf die Dienste von Drittanbietern zuzugreifen, die von <1>Banxa.com</1> über einen In-App-Browser bereitgestellt werden. Alephium hat keine Kontrolle über die Dienstleistungen von Banxa. Es gelten Banxas Geschäftsbedingungen, daher lesen Sie diese bitte bevor Sie fortfahren."
}
2 changes: 0 additions & 2 deletions apps/mobile-wallet/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,9 @@
"Help us improve your experience!": "Help us improve your experience!",
"Require biometrics to open app": "Require biometrics to open app",
"Require device passcode to open app": "Require device passcode to open app",
"Require device screen lock code or pattern to open app": "Require device screen lock code or pattern to open app",
"App access": "App access",
"Require biometrics to transact": "Require biometrics to transact",
"Require device passcode to transact": "Require device passcode to transact",
"Require device screen lock code or pattern to transact": "Require device screen lock code or pattern to transact",
"Your device supports biometrics but none is enrolled. Enable them by adding a fingerprint or Face ID in your device's settings.": "Your device supports biometrics but none is enrolled. Enable them by adding a fingerprint or Face ID in your device's settings.",
"Enhance your security": "Enhance your security",
"Auto-lock": "Auto-lock",
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alephium/mobile-wallet",
"version": "1.1.4",
"version": "1.1.5",
"private": true,
"main": "index.ts",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile-wallet/src/analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export const sendAnalytics = (params: AnalyticsParams) => {
} else {
const { event, props, options } = params

if (props) props.$ip = ''

posthogAsync.then((client) => throttleEvent(() => client.capture(event, props, options), event, props))
}
}
Expand Down
6 changes: 4 additions & 2 deletions apps/mobile-wallet/src/navigation/RootStackNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export default RootStackNavigation
const AppUnlockModal = () => {
const dispatch = useAppDispatch()
const isWalletUnlocked = useAppSelector((s) => s.wallet.isUnlocked)
const lastUsedWalletId = useAppSelector((s) => s.wallet.id)
const biometricsRequiredForAppAccess = useAppSelector((s) => s.settings.usesBiometrics)
const navigation = useNavigation<NavigationProp<RootStackParamList>>()
const { triggerBiometricsAuthGuard } = useBiometricsAuthGuard()
Expand All @@ -166,7 +167,7 @@ const AppUnlockModal = () => {
} catch (error) {
const message = 'Could not initialize app with stored wallet'
showExceptionToast(error, message)
sendAnalytics({ type: 'error', message })
sendAnalytics({ type: 'error', error, message })
}
}, [dispatch, navigation])

Expand Down Expand Up @@ -204,6 +205,7 @@ const AppUnlockModal = () => {
await migrateDeprecatedMnemonic(deprecatedWallet.mnemonic)

dispatch(mnemonicMigrated())
sendAnalytics({ event: 'Mnemonic migrated' })

initializeAppWithStoredWallet()
} catch {
Expand Down Expand Up @@ -250,7 +252,7 @@ const AppUnlockModal = () => {

return (
<Modal
visible={biometricsRequiredForAppAccess && !isWalletUnlocked}
visible={!!lastUsedWalletId && biometricsRequiredForAppAccess && !isWalletUnlocked}
onLayout={handleScreenLayoutChange}
animationType="none"
>
Expand Down
41 changes: 22 additions & 19 deletions apps/mobile-wallet/src/screens/LandingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ import { useAppDispatch, useAppSelector } from '~/hooks/redux'
import altLogoSrc from '~/images/logos/alephiumHackLogo.png'
import AlephiumLogo from '~/images/logos/AlephiumLogo'
import RootStackParamList from '~/navigation/rootStackRoutes'
import { getWalletMetadata } from '~/persistent-storage/wallet'
import { storedWalletExists } from '~/persistent-storage/wallet'
import { methodSelected, WalletGenerationMethod } from '~/store/walletGenerationSlice'
import { BORDER_RADIUS_BIG, BORDER_RADIUS_HUGE } from '~/style/globalStyle'
import { themes } from '~/style/themes'
import { showExceptionToast } from '~/utils/layout'
import { resetNavigation } from '~/utils/navigation'

interface LandingScreenProps extends StackScreenProps<RootStackParamList, 'LandingScreen'>, ScreenProps {}
Expand All @@ -63,18 +62,28 @@ const LandingScreen = ({ navigation, ...props }: LandingScreenProps) => {

const { width, height } = Dimensions.get('window')
const [dimensions, setDimensions] = useState({ width, height })
const [showNewWalletButtons, setShowNewWalletButtons] = useState(false)

// Normally, when the app is unlocked, this screen is not in focus. However, under certain conditions we end up with
// an unlocked wallet and no screen in focus at all. This happens when:
// 1. the auto-lock is set to anything but "Fast"
// 2. the user manually kills the app before the auto-lock timer completes
// 3. the WalletConnect feature is activated
// Since there is no screen in focus and since the default screen set in the RootStackNavigation is this screen, we
// need to navigate back to the dashboard.
const [isScreenContentVisible, setIsScreenContentVisible] = useState(false)

useFocusEffect(
useCallback(() => {
if (isWalletUnlocked) resetNavigation(navigation)
storedWalletExists()
.then((walletExists) => {
if (walletExists) {
// Normally, when the app is unlocked, this screen is not in focus. However, under certain conditions we end
// up with an unlocked wallet and no screen in focus at all. This happens when:
// 1. the auto-lock is set to anything but "Fast"
// 2. the user manually kills the app before the auto-lock timer completes
// 3. the WalletConnect feature is activated
// Since there is no screen in focus and since the default screen set in the RootStackNavigation is this
// screen, we need to navigate back to the dashboard.
if (isWalletUnlocked) resetNavigation(navigation)
} else {
// Only display this screen's contents when we have no stored wallet. If there is a wallet, the
// AppUnlockModal will be displayed
setIsScreenContentVisible(true)
}
})
.catch((error) => console.error('Could not determine if stored wallet exists', error))
}, [isWalletUnlocked, navigation])
)

Expand Down Expand Up @@ -104,16 +113,10 @@ const LandingScreen = ({ navigation, ...props }: LandingScreenProps) => {
setDimensions({ width, height })
}

useEffect(() => {
getWalletMetadata()
.then((metadata) => setShowNewWalletButtons(!metadata))
.catch((e) => showExceptionToast(e, t('Wallet metadata not found')))
}, [t])

return (
<ThemeProvider theme={themes.dark}>
<Screen contrastedBg {...props} onLayout={handleScreenLayoutChange}>
{showNewWalletButtons && (
{isScreenContentVisible && (
<>
<CoolAlephiumCanvas {...dimensions} />

Expand Down
28 changes: 16 additions & 12 deletions apps/mobile-wallet/src/screens/Settings/SettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,26 +221,30 @@ const SettingsScreen = ({ navigation, ...props }: ScreenProps) => {
<Row
title={t('App access')}
subtitle={t(
deviceHasEnrolledBiometrics
? 'Require biometrics to open app'
: Platform.OS === 'ios'
? 'Require device passcode to open app'
: 'Require device screen lock code or pattern to open app'
!deviceHasEnrolledBiometrics && Platform.OS === 'ios'
? 'Require device passcode to open app'
: 'Require biometrics to open app'
)}
>
<Toggle value={isBiometricsEnabled} onValueChange={handleBiometricsAppAccessChange} />
<Toggle
value={isBiometricsEnabled}
onValueChange={handleBiometricsAppAccessChange}
disabled={!deviceHasEnrolledBiometrics && Platform.OS === 'android'}
/>
</Row>
<Row
title={t('Transactions')}
subtitle={t(
deviceHasEnrolledBiometrics
? 'Require biometrics to transact'
: Platform.OS === 'ios'
? 'Require device passcode to transact'
: 'Require device screen lock code or pattern to transact'
!deviceHasEnrolledBiometrics && Platform.OS === 'ios'
? 'Require device passcode to transact'
: 'Require biometrics to transact'
)}
>
<Toggle value={biometricsRequiredForTransactions} onValueChange={handleBiometricsTransactionsChange} />
<Toggle
value={biometricsRequiredForTransactions}
onValueChange={handleBiometricsTransactionsChange}
disabled={!deviceHasEnrolledBiometrics && Platform.OS === 'android'}
/>
</Row>
<Row
onPress={() =>
Expand Down
Loading