Skip to content

Commit

Permalink
Merge branch 'main' into feat/adjusting-fontWeight-bold
Browse files Browse the repository at this point in the history
  • Loading branch information
CarolineLCa authored Jan 29, 2024
2 parents 6d20d25 + 966fedf commit 04b8be7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
35 changes: 19 additions & 16 deletions packages/legacy/core/App/components/misc/ScanCamera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,28 @@ const ScanCamera: React.FC<Props> = ({ handleCodeScan, error, enableCameraOnErro
setOrientation(orientationType)
})

const onCodeScanned = useCallback((codes: Code[]) => {
const value = codes[0].value
if (!value || invalidQrCodes.has(value)) {
return
}
const onCodeScanned = useCallback(
(codes: Code[]) => {
const value = codes[0].value
if (!value || invalidQrCodes.has(value)) {
return
}

if (error?.data === value) {
invalidQrCodes.add(value)
if (enableCameraOnError) {
return setCameraActive(true)
if (error?.data === value) {
invalidQrCodes.add(value)
if (enableCameraOnError) {
return setCameraActive(true)
}
}
}

if (cameraActive) {
Vibration.vibrate()
handleCodeScan(value)
return setCameraActive(false)
}
}, [])
if (cameraActive) {
Vibration.vibrate()
handleCodeScan(value)
return setCameraActive(false)
}
},
[cameraActive]
)

const codeScanner = useCodeScanner({
codeTypes: ['qr'],
Expand Down
1 change: 1 addition & 0 deletions packages/legacy/core/App/contexts/configuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface ConfigurationContext {
disableOnboardingSkip?: boolean
useBiometry: React.FC
useCustomNotifications: () => { total: number; notifications: any }
useAttestation?: () => { start: () => void; stop: () => void; loading: boolean }
whereToUseWalletUrl: string
showScanHelp?: boolean
showScanButton?: boolean
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy/core/App/screens/Connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const Connection: React.FC<ConnectionProps> = ({ navigation, route }) => {
if (state.notificationRecord && goalCode) {
goalCodeAction(goalCode)()
}
}, [connection, oobRecord, goalCode, state.notificationRecord])
}, [connection, connection?.state, oobRecord, goalCode, state.notificationRecord])

useMemo(() => {
startTimer()
Expand Down
11 changes: 6 additions & 5 deletions packages/legacy/core/App/screens/ProofRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, route }) => {
const { ColorPallet, ListItems, TextTheme } = useTheme()
const { RecordLoading } = useAnimatedComponents()
const goalCode = useOutOfBandByConnectionId(proof?.connectionId ?? '')?.outOfBandInvitation.goalCode
const { enableTours: enableToursConfig, OCABundleResolver } = useConfiguration()
const { enableTours: enableToursConfig, OCABundleResolver, useAttestation } = useConfiguration()
const [containsPI, setContainsPI] = useState(false)
const [activeCreds, setActiveCreds] = useState<ProofCredentialItems[]>([])
const [selectedCredentials, setSelectedCredentials] = useState<string[]>([])
Expand All @@ -73,6 +73,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, route }) => {
() => getConnectionName(connection, store.preferences.alternateContactNames),
[connection, store.preferences.alternateContactNames]
)
const { loading: attestationLoading } = useAttestation ? useAttestation() : { loading: false }
const { start } = useTour()
const screenIsFocused = useIsFocused()

Expand Down Expand Up @@ -392,7 +393,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, route }) => {
const proofPageHeader = () => {
return (
<View style={styles.pageMargin}>
{loading ? (
{loading || attestationLoading ? (
<View style={styles.cardLoading}>
<RecordLoading />
</View>
Expand Down Expand Up @@ -490,7 +491,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, route }) => {
const proofPageFooter = () => {
return (
<View style={[styles.pageFooter, styles.pageMargin]}>
{!loading && proofConnectionLabel && goalCode === 'aries.vc.verify' ? (
{!(loading || attestationLoading) && proofConnectionLabel && goalCode === 'aries.vc.verify' ? (
<ConnectionAlert connectionID={proofConnectionLabel} />
) : null}
<View style={styles.footerButton}>
Expand Down Expand Up @@ -536,7 +537,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, route }) => {
renderItem={({ item }) => {
return (
<View>
{loading ? null : (
{loading || attestationLoading ? null : (
<View style={{ marginTop: 10, marginHorizontal: 20 }}>
<CredentialCard
credential={item.credExchangeRecord}
Expand Down Expand Up @@ -581,7 +582,7 @@ const ProofRequest: React.FC<ProofRequestProps> = ({ navigation, route }) => {
<CredentialList
header={
<View style={styles.pageMargin}>
{!loading && (
{!(loading || attestationLoading) && (
<>
{hasMatchingCredDef && (
<View
Expand Down

0 comments on commit 04b8be7

Please sign in to comment.