Skip to content

Send files directly between devices over the internet - no cloud storage, no size limits.

Add additional haptic effects

Denis Lupookov9e302b07bc27
diff --git a/apps/mobile/app/(tabs)/receive/index.tsx b/apps/mobile/app/(tabs)/receive/index.tsx
index a75c513..bcba9e7 100644
--- a/apps/mobile/app/(tabs)/receive/index.tsx
+++ b/apps/mobile/app/(tabs)/receive/index.tsx
@@ -1,4 +1,5 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react'
+import * as Haptics from 'expo-haptics'
import { Button } from '@altersend/components'
import { useTranslation } from '@altersend/locales'
import { useFocusEffect, useRouter } from 'expo-router'
@@ -52,7 +53,12 @@ export default function ReceiveScreen() {
const submitJoin = async () => {
if (isJoining || role !== null) return
setShowValidation(true)
- if (!isValidJoinCode) return
+ if (!isValidJoinCode) {
+ if (trimmedJoinCode.length > 0) {
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error).catch(() => {})
+ }
+ return
+ }
try {
setIsJoining(true)
await joinSession(trimmedJoinCode)
diff --git a/apps/mobile/app/receive/scan.tsx b/apps/mobile/app/receive/scan.tsx
index 4242faf..0d46fcb 100644
--- a/apps/mobile/app/receive/scan.tsx
+++ b/apps/mobile/app/receive/scan.tsx
@@ -7,6 +7,7 @@ import {
type BarcodeScanningResult
} from 'expo-camera'
import * as ImagePicker from 'expo-image-picker'
+import * as Haptics from 'expo-haptics'
import { Button, useTheme, withAlpha } from '@altersend/components'
import { QrCodeIcon } from '@altersend/components/icons'
import { useTranslation } from '@altersend/locales'
@@ -74,6 +75,8 @@ export default function ReceiveScanScreen() {
return
}
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => {})
+
try {
scanLockRef.current = true
setIsResolving(true)
diff --git a/apps/mobile/src/components/PairingManualCodeSheet/index.tsx b/apps/mobile/src/components/PairingManualCodeSheet/index.tsx
index 5646dc8..fa396c9 100644
--- a/apps/mobile/src/components/PairingManualCodeSheet/index.tsx
+++ b/apps/mobile/src/components/PairingManualCodeSheet/index.tsx
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react'
import { StyleSheet, View } from 'react-native'
import * as Clipboard from 'expo-clipboard'
+import * as Haptics from 'expo-haptics'
import { Button, Input } from '@altersend/components'
import { ClipboardIcon } from '@altersend/components/icons'
import { extractJoinCode, joinPairingSession, useTransferStore } from '@altersend/domain'
@@ -57,7 +58,13 @@ export function PairingManualCodeSheet({
const join = async () => {
setShowError(true)
- if (!joinCode || isLoading || role !== null) return
+ if (!joinCode) {
+ if (value.trim().length > 0) {
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error).catch(() => {})
+ }
+ return
+ }
+ if (isLoading || role !== null) return
try {
setIsJoining(true)
await joinPairingSession(joinCode)
diff --git a/apps/mobile/src/components/PairingScanSheet/index.tsx b/apps/mobile/src/components/PairingScanSheet/index.tsx
index 5e8b620..a2b1c20 100644
--- a/apps/mobile/src/components/PairingScanSheet/index.tsx
+++ b/apps/mobile/src/components/PairingScanSheet/index.tsx
@@ -7,6 +7,7 @@ import {
type BarcodeScanningResult
} from 'expo-camera'
import * as ImagePicker from 'expo-image-picker'
+import * as Haptics from 'expo-haptics'
import { Button, useTheme, withAlpha } from '@altersend/components'
import { extractJoinCode, joinPairingSession, useTransferStore } from '@altersend/domain'
import { useTranslation } from '@altersend/locales'
@@ -69,6 +70,8 @@ export function PairingScanSheet({
return
}
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(() => {})
+
try {
scanLockRef.current = true
setIsResolving(true)