Skip to content

Commit

Permalink
Merge pull request #807 from onfido/hotfix/wrong-cross-device-redirec…
Browse files Browse the repository at this point in the history
…tion-cx-4180

Hotfix/wrong cross device redirection cx 4180
  • Loading branch information
seewah authored Oct 3, 2019
2 parents 5a0a1b3 + 22328a6 commit d516054
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This project adheres to the Node [default version scheme](https://docs.npmjs.com
- UI: Accessibility - Make camera feed view accessible to screen readers
- UI: Accessibility - More descriptive ARIA label for camera shutter button
- Public: Fixed user being able to submit verification multiple times on coming back to desktop from the cross device flow if integrator has opted to exclude the `complete` step in SDK setup
- Public: Fix wrong cross device redirection when user is already on mobile (iOS 10)

## [5.3.0] - 2019-09-03

Expand Down
5 changes: 5 additions & 0 deletions src/components/Capture/withCrossDeviceWhenNoCamera.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { h, Component } from 'preact'
import { isDesktop } from '~utils'

export default WrappedComponent =>
class WithCrossDeviceWhenNoCamera extends Component {
Expand Down Expand Up @@ -32,6 +33,10 @@ export default WrappedComponent =>
console.error('Unable to complete the flow: upload fallback not allowed')
return;
}
if (!isDesktop) {
// The cross device option should not be available when the user is already using a mobile device
return;
}
const step = 0
const excludeStepFromHistory = true
changeFlowTo('crossDeviceSteps', step, excludeStepFromHistory)
Expand Down
7 changes: 5 additions & 2 deletions src/components/Uploader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ class Uploader extends Component {
instructions
} = this.props
const isPoA = !!poaDocumentType
const documentTypeGroup = getDocumentTypeGroup(poaDocumentType || documentType)
// Different upload types show different icons
// return the right icon name for document or face step
// For document, the upload can be 'identity' or 'proofOfAddress'
const uploadType = getDocumentTypeGroup(poaDocumentType || documentType) || 'face'
const UploadArea = isDesktop ? DesktopUploadArea : MobileUploadArea
const { error } = this.state

Expand All @@ -113,7 +116,7 @@ class Uploader extends Component {
{ ...{ isPoA } }
>
<div className={ style.instructions }>
<span className={ classNames(theme.icon, style.icon, style[`${ camelCase(documentTypeGroup) }Icon`]) } />
<span className={ classNames(theme.icon, style.icon, style[`${camelCase(uploadType)}Icon`]) } />
{ error ?
<UploadError { ...{ error } } /> :
<div className={ style.instructionsCopy }>{ instructions }</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Uploader/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}
}

.identityIcon {
.identityIcon, .faceIcon {
&:extend(.icon);
background-image: url('assets/upload.svg');

Expand Down

0 comments on commit d516054

Please sign in to comment.